Also, it is worthwhile reading the standard proposal paper for lot of examples of how this might be used in the future.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p29...
I am looking forward to compile-time reflection, C++ has unusually strong metaprogramming capabilities among systems languages and this will significantly bolster that.
C++ does not win any prizes for being the most aesthetically pleasing programming language but the new syntax around reflection is pretty ugly even by those standards.
Oh noes, the binding of internal compiler state to STL will become even more severe with this. It started slowly. You needed exact magic std::initializer_list definition in your headers to match the code generated by the compiler, or the program would crash. RTTI (that was of little use to programs that tried to avoid standard library) Now there are coroutines and this thing. I feel like it is bye-bye to the completely non-standard compliant practice of using C++ without all the standard library. Where should embedded c++ projects go now that they are not welcome anymore?
Seems like maybe it will be a challenge to use, but like a lot of template stuff the complexity gets buried in the library. The language gets a lot of ridicule but I like the no-compromise push to help programmers eliminate unnecessary runtime work in their programs.
C++ became more and more cryptic. Make C++ code creation programmable (templating) by basic c++ syntax at compile time. Make this a part of the standard library.
How about thin C++ wrapper? The language with the same features, but more human friendly. It should be easily directly translated to C++. Preferably both ways.
Wow. That is... certainly some syntax. It reminds me of Perl.
This syntax is pretty weird even by C++ standards, and it's certainly the worst way to do reflection I've personally seen. But I guess it's good that C++ is finally getting some kind of reflection. Only a few decades late to the party but hey they got there in the end.
Really as C++ grows and evolves, I feel more and more that I'd rather use plain C than wrangle with all of the bizzarro choices C++ has made. C++ is more and more often just the wrong choice of language for anything I want to do. If I need compile-time reflection, I'll use a C# program to generate C code.