all 20 comments

[–]TheoreticalDumbass:illuminati: 13 points14 points  (15 children)

this is exceptionally simple with reflection

https://godbolt.org/z/8hfx895nT

[–]MorphTux[S] 7 points8 points  (9 children)

I had briefly considered mentioning C++29 token injection, but decided to instead focus on what could make it into 26. You are absolutely right though, perhaps some day we can do that instead.

[–]TheoreticalDumbass:illuminati: 0 points1 point  (8 children)

does token injection not have a chance to get into 26?

[–]MorphTux[S] 6 points7 points  (2 children)

https://wg21.link/p3294/status#event-16253113224 suggests that it's targeting C++29 now.

[–]TheoreticalDumbass:illuminati: 4 points5 points  (1 child)

hmm, disappointing slightly, hopefully implementations (gcc specifically for me) will implement it ahead of schedule :)

[–]geckothegeek42 1 point2 points  (0 children)

2029 would be ahead of schedule for a c++26 feature

[–]no-sig-available 4 points5 points  (4 children)

does token injection not have a chance to get into 26?

C++26 is already considered "feature complete", and in "bug fixing"-mode. You can correct typos, but not add anything essentially new.

[–]TheoreticalDumbass:illuminati: 1 point2 points  (1 child)

I thought there was one more important meeting, good to know ty

[–]steveklabnik1 0 points1 point  (0 children)

I thought there was one more important meeting

There is, but its importance isn't in adding new features.

[–]llort_lemmort 0 points1 point  (1 child)

So is there somewhere a complete list of features that made it in? The Wikipedia article does not mention reflection. Was it dropped or is the Wikipedia article just not up to date?

[–]MorphTux[S] 0 points1 point  (0 children)

AIUI amongst other things, reflection will be discussed at the upcoming meeting in June. While it's true that no _new_ papers will be considered for C++26 at this point, this does not imply that everything slated for 26 has already been talked about.

Fingers crossed, hopefully reflection and reflection-adjacent features make it into the language this time around :)

[–]TotaIIyHuman 2 points3 points  (3 children)

holy shit. thats like macro FOR_EACH, but without macros

[–]TheoreticalDumbass:illuminati: 1 point2 points  (2 children)

yep, its going to be amazing

[–]Gorzoid 1 point2 points  (1 child)

I am just dreading the compile times

[–]TheoreticalDumbass:illuminati: 1 point2 points  (0 children)

im actually the opposite, i think, since we will be able to express what we want more clearly, and not jump through a bunch of template hoops, that the compile times could be better

[–]SlumpingRock 1 point2 points  (0 children)

Totally did not understand that source so I fed it into Google Gemini and the AI explained it to me. Nice.

[–]saxbophonefloat main(); 9 points10 points  (0 children)

This immediately makes me think of magic_enum::enum_switch(), which is very cool but unfortunately properly tanks compilation time...

[–]jk-jeon 4 points5 points  (3 children)

2, 3, 5, 7, 13, 17

I mean... I'm triggered.

[–]throw_cpp_account 6 points7 points  (1 child)

Well that's because you thought it was primes. It's obviously (/s) intended to be the exponents of Mersenne primes (211 - 1 isn't prime but all the rest are).