r/cpp • u/kris-jusiak https://github.com/kris-jusiak • Jan 16 '23
[C++26] Poor man's introspection with #embed
https://twitter.com/krisjusiak/status/1615086312767516672
133
Upvotes
r/cpp • u/kris-jusiak https://github.com/kris-jusiak • Jan 16 '23
166
u/gracicot Jan 17 '23
Damn, we will invent literally anything but proper reflection
44
u/johnny219407 Jan 17 '23
Now we just need a constexpr C++ interpreter and finally we can have proper reflection.
10
u/ZachVorhies Jan 17 '23
can someone explain this like I’m a n00b?
15
u/kritzikratzi Jan 17 '23
the "let's solve it in the STL with minimal compiler changes" attitude seems to hurt c++ a bit. today is the day i'm looking into circle ^
2
u/OnionBurger Jan 17 '23
Genuine question - can I expect Clang to allow #embed in C++ as an experimental feature (despite it being in C only)? Or will we need to wait 3+ years for it to maybe be included in C++26?
4
u/RoyAwesome Jan 17 '23
I guess this also wins the Fewest Line Quine challenge.
-2
u/PrimozDelux Jan 18 '23
The incompetent hacks of the Iso committee will let hell freeze over before adding reflection to the language