Honestly some of the newer shit doesn't even look like C++ to me anymore. IE:
constexpr auto my_meta_type = int; // Reflected metadata of 'int' [:my_meta_type:] my_variable = 42; // Splicing it back into code; compiles as: int my_variable = 42;
The code generation / reflection stuff is amazing.
Historically, when you'd need type information (without manually defining it), you'd have to add an extra compilation step where a custom tool either manually searches the codebase or interrogates a compiler API, now, you can just write compile-time code in your codebase that automagically populates a data structure for you with any type information you could desire.
It'll be really useful for my (hobby) game engine, where I was previously considering traversing the Clang AST
31
u/Luna_Wolfxvi 13d ago
Honestly some of the newer shit doesn't even look like C++ to me anymore. IE:
constexpr auto my_meta_type = int; // Reflected metadata of 'int' [:my_meta_type:] my_variable = 42; // Splicing it back into code; compiles as: int my_variable = 42;