Andrew Sutton covers the core concepts of reflection and reification in C++ and discusses language support approaches.
#Programming #Cpp #AccuConf
Slides: accu.org/conf-previous/2021/schedule/
ACCU Website: accu.org
ACCU Conference Website: conference.accu.org
ACCU Twitter: @ACCUConf
Streamed & Edited By Digital Medium Ltd: events.digital-medium.co.uk
------
Static reflection is a forthcoming feature in the C++ programming that promises powerful new features for compile-time introspection of user source code. This feature, supported by increasingly capable constexpr facilities, will potentially be the Next Big Thing for C++23. This talk will cover the core concepts of reflection and reification and discuss several methods of providing language support for those features, including the approach taken by current Reflection TS and alternative approaches that are currently being considered. The remainder of the talk will present examples of how reflection can be used to augment traditional generic programming techniques to develop even more general algorithms based on introspection of class properties.
------
Andrew Sutton
Andrew Sutton is an owner of Lock3 Software, LLC where he designs languages, language features, and works on various compilers. Most of his work is focused on the C programming language. Some of Andrew’s current projects include the GCC implementation of C concepts, designing and implementing static reflection and metaprogramming for C using Clang, and the design and implementation of new programming languages. Andrew was formerly a university professor and taught undergraduate courses on programming with C, programming languages, and compiler design.
------
Future Conferences:
ACCU 2022 Spring Conference, Bristol (UK), Marriott City Centre:
2022-04-05 to 2022-04-09.
-------------------------
Why it's here
1 person recommends this
What people say. Recommended as a resource on compile-time reflection in C++.
D
Damian Dixonon Stack Overflow • Recommends
On “How can I add reflection to a C++ application?”
Compile time reflection is now in C++26 as of March 28th 2026:
Final compile time paper.
Previous:
Reflection is not currently supported by C++ out of the box. This is sad because it makes defensive testing a pain. However it looks like compile time reflection maybe coming to C++26.
For now there are several approaches to doing reflection:
use the debug information (non portable).
Sprinkle your code with macro's/templates or some other source approach (looks ugly)
Modify a compiler such as clang/gcc to produce a database.
Use Qt moc approach
Boost Reflect
Precise and Flat Reflection
The first link looks the most promising (uses mod's to clang), the second discusses a nu…