News for hackers. Stuff that matters.
Re:C++26 Reflections adventures and compile time UML by comex on Sunday August 03, 2025 @03:56AM (#44774925)
You can write a parser for an IDL, but you can’t reasonably write a parser for C++. So you have to move the definition of whatever types of methods or fields you want to reflect on into the IDL, instead of defining them natively in C++. (Or worse, have separate definitions in both the IDL and C++.) Which tends to be cumbersome – especially if you want to define a lot of generic types (since then the code generator can’t statically determine the full list of types). It can work, but there’s a reason I rarely see anyone using this approach.
Re:C++26 Reflections adventures and compile time UML by tw061023 on Sunday August 03, 2025 @05:24AM (#44775298)
Why would I want to write a C++ parser?

IDL/DDL is the source of truth, moving the type definitions there is the whole point. There is only one definition for each type, which is in the *DL, corresponding C++ headers are generated and everything is statically known.