r/cpp • u/ProgrammingArchive • Jul 11 '26
C++Now C++Now 2026 Keynote: Reflection Is Only Half the Story - Barry Revzin
https://youtu.be/DZTkT1Cq_aY
69
Upvotes
r/cpp • u/ProgrammingArchive • Jul 11 '26
5
u/TheoreticalDumbass :illuminati: Jul 11 '26
i found this part interesting (question, and more importantly answer): https://www.youtube.com/watch?v=DZTkT1Cq_aY&t=2831s
interesting as in good, the notion of a pseudo token representing an entity we already parsed
i find it so good that imo functions `parse_as_type(token_sequence) -> info` and `parse_as_expression(token_sequence) -> ???` would be really nice, in case of broken/buggy code synthesis it would let you error early instead of at the final potentially huge token sequence (it might also improve debugging if it fails late bc compiler can tell you a bit more structured info on the huge sequence like "this treated as an expression" )
just noting i dont want to replace token sequences with these, just in addition, imo something absolutely general as token sequences are necessary for whatever future C++ becomes
would there be value in C preprocessor hooks like `preprocess(string_view) -> token_sequence` ? only accessing the preprocessing, at the moment i think modifying preprocessor state is just impossible/nonsensical (like no sense in `define_preprocessor_macro("FOO", "123")` being as-if `#define FOO 123` because this would be done in phase 7+ , and phase 4 is allowed to fully complete before phase 7 even starts)
10
u/johannes1971 Jul 11 '26
Lots of interesting stuff. Meanwhile, Microsoft has the implementation of any C++26 features as "under review"...
1
u/Arlen_ Jul 15 '26
That was a great talk. Are there any books that cover C++ Reflection yet?
1
u/riztazz Jul 26 '26
Great talk, learned a ton!
Such a smart way to use the text version of operators when showing the code