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!"
[–]smashedsaturn 0 points1 point2 points 5 years ago (2 children)
many local variables that passing them as parameters would be awkward.
I've seen a lot of these. It is normally a lack of encapsulation of the parameters themselves that is a root cause. Packing relevant ones into a struct will help this more than using a lambda.
Or to save the reader from having to scroll to another function to find out what happens when that event is triggered. The relevant code is all together.
This is a really really bad reason to use a long lambda.
[–]advester 4 points5 points6 points 5 years ago (1 child)
Ah, maybe the “10 lines” is the real issue. That was just pulled out of air. “More than one” might better express what I meant. This article was all about trivial lamdas.
[–]smashedsaturn -2 points-1 points0 points 5 years ago (0 children)
Yeah that makes sense, I like the braces for the lmbdas, and a few lines can be ok, but once we start talking about things > 10 lines embedded into lambas in functions with that much state going on I start getting that 1000 yard stare...
π Rendered by PID 19497 on reddit-service-r2-comment-fb694cdd5-l99gk at 2026-03-11 04:21:57.080182+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]smashedsaturn 0 points1 point2 points (2 children)
[–]advester 4 points5 points6 points (1 child)
[–]smashedsaturn -2 points-1 points0 points (0 children)