Reflection for C++26

This web content outlines a proposal for static reflection in C++, focusing on a reduced initial set of features. The proposal includes a single opaque reflection type, a reflection operator (^), consteval metafunctions, and splicers for grammatical elements. The content also discusses why a single reflection type is preferred over multiple types to avoid constraining language evolution. Implementation status of the proposal in Clang and EDG is also provided, along with examples demonstrating the capabilities of the proposed features. Surprising additions include metafunctions for synthesizing struct and union types, expanding statements, and non-transient constexpr allocation. References to Compiler Explorer demonstrate the implementation of examples.

https://isocpp.org/files/papers/P2996R4.html

To top