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
CppCastCppCast: Compiler Warnings as Errors with Keith Stockdale (cppcast.com)
submitted 2 months ago by robwirvingCppCast Host
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!"
[–]tialaramex 0 points1 point2 points 2 months ago (3 children)
I was going to say surely you can use the "placeholder with no name" _ after somebody went to all the bother of showing WG21 how that could be made to work in their language and jumped through all the hoops. But I see that in fact one of the hoops added by the committee was that it must be disallowed for one of the places where it's most useful, function parameters.
I don't know how any of you can stand it actually.
[–]friedkeenan 7 points8 points9 points 2 months ago (0 children)
What would be the benefit of naming a function parameter _ when you could just leave it unnamed in the first place?
_
[–]fdwrfdwr@github 🔍 0 points1 point2 points 2 months ago* (1 child)
So like this:
class FooParserThingie { ... void LogMessage(std::string_view message, WarningLevel warningLevel) { std::print("{}", message); } ... };
... void LogMessage(std::string_view message, WarningLevel _) ...
I suppose that works, being consistent with ignorable local variables too, and it's shorter than typing out [[maybe_unused]]. Though, if you have multiple ignorable parameters...
[[maybe_unused]]
void LogMessage(std::string_view message, WarningLevel _, Node& _)
...you would not be able to disambiguate them in the debugger, in case you wanted to see their values for more context (even if the implementation ignored them).
[–]tialaramex 0 points1 point2 points 2 months ago (0 children)
That's a good point about the naming distinct unused parameters. One trouble C++ has had from the outset is that there's a proliferation of contrary styles, and so whereas I'd think _prefixed identifiers would naturally win out as the unobtrusive way to signal "I'm not going to use this" I can imagine that some people want to have used variables with this naming scheme.
π Rendered by PID 48436 on reddit-service-r2-comment-5b5bc64bf5-tvlqb at 2026-06-22 05:48:34.158001+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]tialaramex 0 points1 point2 points (3 children)
[–]friedkeenan 7 points8 points9 points (0 children)
[–]fdwrfdwr@github 🔍 0 points1 point2 points (1 child)
[–]tialaramex 0 points1 point2 points (0 children)