Portable Reflection in C++26

Dan Katz

⏱ 90 minute session
advanced
14:00-15:30, Friday, 19th June 2026

At last! C++26 delivers a powerful reflection framework for inspecting the content and structure of programs. Alas, such powerful tools come replete with perils: The stateful nature of compilation, together with a diverse landscape of compilers, makes it all too easy to write non-portable metaprograms that might work with one compiler, but not another.

This talk will discuss how Reflection surfaces program properties that change over time: Class completeness, namespace members, parameter names, and more. We'll see examples that demonstrate how the observation of such properties can lead to non-portable code, especially when combined with templates. Finally, we'll learn general principles and best practices to help navigate these hazards, allowing us to write powerful, portable, and future-proof reflection-driven metaprograms.


🏷 reflection
🏷 templates
🏷 portability

Dan Katz

I'm a Senior Software Engineer for Adobe and a member of the ISO C++ Standard Committee. I was one of the lead authors of the Reflection papers for C++26: My contributions included being the primary author of the experimental Clang implementation, and being the primary author of the formal wording that was accepted into the Committee Draft in June 2025.