You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -70,12 +67,15 @@ auto cxx_mirror = rtl::CxxMirror({
70
67
```
71
68
The `cxx_mirror` object is your gateway to runtime reflection — it lets you query, introspect, and even instantiate types without any compile-time knowledge. It can live anywhere — in any translation unit, quietly resting in a corner of your codebase, remaining dormant until first access. All you need is to expose the `cxx_mirror` wherever reflection is required.
72
69
73
-
And what better way to do that than a **Singleton**:
70
+
And what better way to do that than a **Singleton**:*`(MyReflection.h)`*
74
71
```c++
75
-
structcxx { static rtl::CxxMirror& mirror(); };
72
+
namespacertl { class CxxMirror; } // Forward declaration, no includes here!
73
+
struct cxx { static rtl::CxxMirror& mirror(); }; // The Singleton.
76
74
```
77
-
define and register everything in an isolated translation unit.
75
+
define and register everything in an isolated translation unit. *`(MyReflection.cpp)`*
0 commit comments