A deep dive into C++26 reflection features to build compile-time key-value maps and a compile-time mutable variable (CMV). Starting from the compile-time ticket counter pattern (P2996R13 §3.17), the post explains how `substitute`, `is_complete_type`, and `define_aggregate` work, then builds an immutable CT_map using template specializations keyed by `meta::info` reflections. It extends this to a CMV that stores any reflectable value and supports binary-search-based version tracking. Finally, it combines both to create a mutable compile-time map. All examples include Godbolt links and a GitHub repository with additional tools like a universal enum and compile-time RNG.
Table of contents
IntroductionCompile-Time Ticket Counter (P2996R13 §3.17)Compile-Time MapCompile-Time Mutable VariableA Mutable Compile-Time Map?What Reflection AddsConclusionBibliographySort: