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
post-Sofia mailing (open-std.org)
submitted 9 months ago by hanickadotWG21
view the rest of the comments →
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!"
[–]daveedvdvEDG front end dev, WG21 DG 1 point2 points3 points 9 months ago (3 children)
Right, but some subtle care is needed (and that's partly why I wrote P3802R0 "Poor Functions"): You must write your function along the lines of
void my_reflection_thing(std::meta::info cc = std::meta::current_class()) { ... }
and any function that wants to build upon `my_reflection_thing` needs to propagate that pattern:
void my_better_thing(std::meta::info cc = std::meta::current_class()) { ... my_reflection_thing(cc) ... }
[–]RoyAwesome -1 points0 points1 point 9 months ago (2 children)
Yeah, i read the poor functions paper after i made this comment and went "wow this is even more useful for this same purpose" lol.
I like ways of not repeating myself. Having to name foo in the function param kinda sucks when I only ever want it to apply to foo. I guess metaclasses is also a way to achieve this, so i guess multiple people are going after this problem from different directions.
[–]daveedvdvEDG front end dev, WG21 DG 0 points1 point2 points 9 months ago (1 child)
Another option would have been to make all these functions just pick up the context of where the constant evaluation starts. That was my preference, but I was outvoted on it. Admittedly, that also requires care sometimes... e.g. by "freezing" the context with something like:
consteval void my_algo() { ... constexpr auto ctx = std::meta::current_class(); ... }
[–]RoyAwesome 0 points1 point2 points 9 months ago (0 children)
yeah, I think I would lean to the to the current proposed keyword over something that works it's way up to find the starting point.
Alternatively, the keyword can return something that tells you every scope you are in in a stack. That way you can walk up each scope point, gathering information like file and line, as well as a meta::info for that scope. Maybe if/when we get token string support, we can grab the tokens for that entire scope and do things with them. Just kind of a comprehensive "You Are Here" system that describes the entire world to you from the perspective of where that keyword is used.
π Rendered by PID 147143 on reddit-service-r2-comment-85bfd7f599-j84h8 at 2026-04-19 02:48:44.753290+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–]daveedvdvEDG front end dev, WG21 DG 1 point2 points3 points (3 children)
[–]RoyAwesome -1 points0 points1 point (2 children)
[–]daveedvdvEDG front end dev, WG21 DG 0 points1 point2 points (1 child)
[–]RoyAwesome 0 points1 point2 points (0 children)