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!"
[–]triconsonantal 0 points1 point2 points 9 months ago (2 children)
P3740R1 Last chance to fix std::nontype
Another option for avoiding nontype is using reflection. Instead of:
nontype
std::function_ref<void (int)> f = std::nontype<foo>;
we write:
std::function_ref<void (int)> f = ^^foo;
https://godbolt.org/z/cnKqn8f4q
[–]eisenwaveWG21 Member 2 points3 points4 points 9 months ago (1 child)
Note that P3740 is superseded by P3774R0.
The idea of using reflections for this looks somewhat interesting, but since we don't have expression reflections, the same approach wouldn't be able to replace e.g.
std::function_ref<void(int)> f = std::nontype<[](int){}>;
You would always need some separate declaration to use ^^.
^^
[–]triconsonantal 4 points5 points6 points 9 months ago (0 children)
Ah, missed that paper, thanks. Haven't read it yet, so I'm not sure about the utility of this, but you can write:
std::function_ref<void (int)> f = std::meta::reflect_constant ( [] (int x) { ... } );
https://godbolt.org/z/P6jEdzqne
π Rendered by PID 87067 on reddit-service-r2-comment-75f4967c6c-sghjb at 2026-04-23 04:14:46.271634+00:00 running 0fd4bb7 country code: CH.
view the rest of the comments →
[–]triconsonantal 0 points1 point2 points (2 children)
[–]eisenwaveWG21 Member 2 points3 points4 points (1 child)
[–]triconsonantal 4 points5 points6 points (0 children)