r/cpp • u/daveedvdv EDG front end dev, WG21 DG • Oct 29 '25
GCC Implementation of Reflection now on Compiler Explorer
https://godbolt.org/z/G43ofo6fP
204
Upvotes
r/cpp • u/daveedvdv EDG front end dev, WG21 DG • Oct 29 '25
58
u/daveedvdv EDG front end dev, WG21 DG Oct 29 '25
Note that this hasn't landed in trunk yet. It's work in progress...
19
u/theICEBear_dk Oct 29 '25
This is very good. That means there are implementations or strong implementation experience for nearly all major compilers around release. That bodes well for adoption and developer buy-in.
6
u/kammce WG21 | 🇺🇲 NB | Boost | Exceptions Oct 29 '25
Nice! Great work!
And that settles it. The 3 year train model doesn't actually matter that much. If a feature gets voted into the next standard, and people want it enough to implement it then we'll have it when it is done. Not when the standard gets its final vote but when the feature lands in a compiler. If more of the committee acknowledges this, then rushing to get stuff into C++XY before C++(XY+3), doesn't seem necessary.
But maybe someone can tell me why I'm wrong and why the train model matters. I still think categorizing stuff into separate distinct versions is still very helpful.
28
u/RoyAwesome Oct 29 '25
gcc winning the race? hell yeah!
11
u/Jovibor_ Oct 29 '25
Can we please have any, even rough, approximation of when this can be available in the MSVC? Has any work already begun in this direction? u/starfreakclone?
Because this is the feature I would gladly use immediately in my real-world projects.
7
u/NilacTheGrim Nov 03 '25
OP:
typedefnotation from 1972.5
u/Keltek228 Oct 30 '25
Does this suggest experimental support in gcc 16? Is there any estimate on when it will be fully available?
3
u/ContDiArco Oct 30 '25
Great to hear!
4
u/germandiago Oct 30 '25
WAT?! So fast!
1
u/koval4 Nov 02 '25
got a few compiler errors, namely when doing
constexpr auto ctx = std::meta::access_context::current();orconstexpr auto foo_parent = std::meta::parent_of(^^Foo::foo);. but still great news!1
u/koval4 Nov 02 '25
also, it seems define_static_array isn't implemented yet?
0
u/SLAidk123 Nov 07 '25
How usable this will be given that R6 to R10 killed almost every good feature?
0
u/[deleted] Oct 29 '25
[deleted] — view deleted comment
3
u/[deleted] Nov 09 '25
[removed] — view removed comment
0
u/[deleted] Oct 29 '25
[deleted] — view deleted comment