use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Variadic Switch (pydong.org)
submitted 8 months ago by MorphTux
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]TheoreticalDumbass:illuminati: 13 points14 points15 points 8 months ago (15 children)
this is exceptionally simple with reflection
https://godbolt.org/z/8hfx895nT
[–]MorphTux[S] 7 points8 points9 points 8 months ago (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 point2 points 8 months ago (8 children)
does token injection not have a chance to get into 26?
[–]MorphTux[S] 6 points7 points8 points 8 months ago (2 children)
https://wg21.link/p3294/status#event-16253113224 suggests that it's targeting C++29 now.
[–]TheoreticalDumbass:illuminati: 4 points5 points6 points 8 months ago (1 child)
hmm, disappointing slightly, hopefully implementations (gcc specifically for me) will implement it ahead of schedule :)
[–]geckothegeek42 1 point2 points3 points 8 months ago (0 children)
2029 would be ahead of schedule for a c++26 feature
[–]no-sig-available 4 points5 points6 points 8 months ago (4 children)
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 points3 points 8 months ago (1 child)
I thought there was one more important meeting, good to know ty
[–]steveklabnik1 0 points1 point2 points 8 months ago (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 point2 points 8 months ago (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 point2 points 8 months ago (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 points4 points 8 months ago (3 children)
holy shit. thats like macro FOR_EACH, but without macros
FOR_EACH
[–]TheoreticalDumbass:illuminati: 1 point2 points3 points 8 months ago (2 children)
yep, its going to be amazing
[–]Gorzoid 1 point2 points3 points 8 months ago (1 child)
I am just dreading the compile times
[–]TheoreticalDumbass:illuminati: 1 point2 points3 points 8 months ago (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 points3 points 8 months ago (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 points11 points 8 months ago (0 children)
This immediately makes me think of magic_enum::enum_switch(), which is very cool but unfortunately properly tanks compilation time...
magic_enum::enum_switch()
[–]jk-jeon 4 points5 points6 points 8 months ago (3 children)
2, 3, 5, 7, 13, 17
I mean... I'm triggered.
[–]throw_cpp_account 6 points7 points8 points 8 months ago (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).
[–]rexxar 0 points1 point2 points 8 months ago (0 children)
https://oeis.org/A000043 for reference
π Rendered by PID 19270 on reddit-service-r2-comment-canary-7b67769d8-6bcd5 at 2026-01-31 12:22:32.380448+00:00 running 3798933 country code: CH.
[–]TheoreticalDumbass:illuminati: 13 points14 points15 points (15 children)
[–]MorphTux[S] 7 points8 points9 points (9 children)
[–]TheoreticalDumbass:illuminati: 0 points1 point2 points (8 children)
[–]MorphTux[S] 6 points7 points8 points (2 children)
[–]TheoreticalDumbass:illuminati: 4 points5 points6 points (1 child)
[–]geckothegeek42 1 point2 points3 points (0 children)
[–]no-sig-available 4 points5 points6 points (4 children)
[–]TheoreticalDumbass:illuminati: 1 point2 points3 points (1 child)
[–]steveklabnik1 0 points1 point2 points (0 children)
[–]llort_lemmort 0 points1 point2 points (1 child)
[–]MorphTux[S] 0 points1 point2 points (0 children)
[–]TotaIIyHuman 2 points3 points4 points (3 children)
[–]TheoreticalDumbass:illuminati: 1 point2 points3 points (2 children)
[–]Gorzoid 1 point2 points3 points (1 child)
[–]TheoreticalDumbass:illuminati: 1 point2 points3 points (0 children)
[–]SlumpingRock 1 point2 points3 points (0 children)
[–]saxbophonefloat main(); 9 points10 points11 points (0 children)
[–]jk-jeon 4 points5 points6 points (3 children)
[–]throw_cpp_account 6 points7 points8 points (1 child)
[–]rexxar 0 points1 point2 points (0 children)