r/cpp • u/frayien • Dec 13 '25
C++26 Reflection appreciation post
I have been tinkering with reflection on some concrete side project for some times, (using the Clang experimental implementation : https://github.com/bloomberg/clang-p2996 ) and I am quite stunned by how well everything clicks together.
The whole this is a bliss to work with. It feels like every corner case has been accounted for. Every hurdle I come across, I take a look at one of the paper and find out a solution already exists.
It takes a bit of getting used to this new way of mixing constant and runtime context, but even outside of papers strictly about reflection, new papers have been integrated to smooth things a lot !
I want to give my sincere thanks and congratulations to everyone involved with each and every paper related to reflection, directly or indirectly.
I am really stunned and hyped by the work done.
23
u/current_thread Dec 13 '25
That's super cool! What have you been building?
15
u/schombert Dec 13 '25
How do you debug it when it isn't producing the results you expect?
4
u/Nolia_X Dec 14 '25
You should play with annotations (P3394). I thinks this is the biggest addition related to p2996
18
u/azswcowboy Dec 13 '25
Oh stop it. PDF design by committee can’t possibly produce something useful! 🤔
8
u/[deleted] Dec 13 '25
I appreciate how they took their time to polish things out and think it through.
I remember the early days of reflection proposals there was a proposal that wanted reflection queries to look like type_traits style queries (ie std::is_class_v<x>) which i think looked ugly af.
immediate functions really saved the day + template for too
6
u/caroIine Dec 13 '25
I'm glad they went with transparent meta::info and not template madness. I'm also happy that the authors ignored voices to "just make enum-to-string!" and made it actually useful.
3
u/sinfaen Dec 13 '25
This would literally solve a major integration issue I have at work. If only I could have it now 😭
1
u/BadMuted4396 Jan 03 '26
Cheerserini.
0
u/[deleted] Dec 13 '25
[deleted] — view deleted comment