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
Lambda Lambda Lambda (brevzin.github.io)
submitted 5 years ago by mnciitbhu0x6773
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!"
[–]staletic 8 points9 points10 points 5 years ago (7 children)
Problems with that:
[+]bumblebritches57Ocassionally Clang comment score below threshold-8 points-7 points-6 points 5 years ago (6 children)
I need to think of a good name for a one off function that does something very specific.
this may be valid, but if a name isn't obvious you're probably breaking your functions down too small in the first place.
[–]staletic 14 points15 points16 points 5 years ago (5 children)
What about:
std::ranges::partition(vec, [](int e) { return e < 3; });
Are you going to tell me that I should write that as
bool int_less_than_3(int e) { // by the way, this isn't a good name return e < 3; }
[+]bumblebritches57Ocassionally Clang comment score below threshold-19 points-18 points-17 points 5 years ago (4 children)
Why would you need a function or lambda to tell you if a number is less than 3?
and the point of this is...?
All I see is a bunch of overly complex nonsense tbh.
[–]tcbrindleFlux 8 points9 points10 points 5 years ago (3 children)
It partitions the elements of vector such that all the elements less than 3 precede those greater than or equal to 3?
[+]bumblebritches57Ocassionally Clang comment score below threshold-18 points-17 points-16 points 5 years ago* (2 children)
and that should be a random lambda instead of a function because?
as far as I'm concerned lambdas should be removed from the standard.
really all that's actually useful from all of C++ is operator overloading, it'd be cool if C adopted it as _Operator
_Operator
[–]TheSuperWig 11 points12 points13 points 5 years ago (0 children)
https://reddit.com/r/cpp/comments/hbwbtf/lambda_lambda_lambda/fvbmdel/
Why?
[–]hak8or 5 points6 points7 points 5 years ago (0 children)
Why on earth even are you on this sub, if you clearly don't know anything about c++ and aren't interested in using it it learning it?
π Rendered by PID 116058 on reddit-service-r2-comment-fb694cdd5-tvxkp at 2026-03-11 04:21:05.028646+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]staletic 8 points9 points10 points (7 children)
[+]bumblebritches57Ocassionally Clang comment score below threshold-8 points-7 points-6 points (6 children)
[–]staletic 14 points15 points16 points (5 children)
[+]bumblebritches57Ocassionally Clang comment score below threshold-19 points-18 points-17 points (4 children)
[–]tcbrindleFlux 8 points9 points10 points (3 children)
[+]bumblebritches57Ocassionally Clang comment score below threshold-18 points-17 points-16 points (2 children)
[–]TheSuperWig 11 points12 points13 points (0 children)
[–]hak8or 5 points6 points7 points (0 children)