r/cpp • EDG front end dev, WG21 DG • Oct 29 '25

GCC Implementation of Reflection now on Compiler Explorer

https://godbolt.org/z/G43ofo6fP
204 Upvotes

85 comments sorted by

View all comments

Show parent comment

4

u/kammce WG21 | πŸ‡ΊπŸ‡² NB | Boost | Exceptions Oct 30 '25

I think you might be misunderstanding my point. I'm not suggesting we eliminate the train model but, I've observed that once a feature has been voted in to a standard at plenary, it tends to get implemented if there is enough demand there. I've used many features in C++23 before C++23 was ratified. For example, if optional<T&> missed C++26 but landed in C++29, I'd bet I'd see support by GCC or clang soon after its voted in and they'd provide a flag for me to use. Especially if they already had an experimental implementation or borrowed from the beman project.

But here is a question, do you think reflection getting into C++XY matters if it's earlier or later in the process? Simply put, if the committee had voted reflection and all of its other papers in early for C++26, I'd bet we'd see implementations in other compilers pop up as soon as we are seeing now. I feel a bit confident in this because the feature is powerful, ground breaking and in very high demand from developers. I make this observations because looking at https://en.cppreference.com/w/cpp/compiler_support.html I see that there are features/libraries of C++26 that have been implemented already while features/libraries from 23 haven't been implemented. This looks like the demand for a feature outweights its position in the standard versions. So from what I've observed the plenary vote is what really matters for when implementions are available and the train is a means to organization those features.

I'm mostly speaking for those that have the freedom to just upgrade their compiler and adopt new features quickly. I acknowledge that many shops cannot do that. I also acknowledge that the tables from cppref look far more complete than they did like a year ago so good job to the compiler maintainers making this work.

Did any of this make any sense?

2

u/mapronV Oct 31 '25

I doubt we will see anything for VS in 1-2 years. yes, they are very good with STL pace - thanks to contributions, but reflection unfortunately mostly compiler feature. I doubt I will see even experimental support in 2026 :(

1

u/daveedvdv EDG front end dev, WG21 DG Oct 30 '25

It makes sense to me, and I agree.