Runtime Reflection in C++

Inspecting and manipulating types at runtime — from RTTI to custom systems

Iteration

I developed two RTTI systems. The first used a templatized class to store reflected values, which meant every instance of a class containing reflected variables also carried redundant metadata - type names, offset information, and validation flags - duplicated across hundreds or thousands of objects. That scrap data should have been stored in a central type registry, not per-instance.

The newer system fixes this by moving to compile-time reflection. All metadata is generated once per type during static initialization and shared across all instances. The per-object footprint is now just the raw data - no overhead, no duplication.