en.cppreference.com favicon

Lambda expressions (since C++11) - cppreference.com

5
Public whispers
5
Contributors
2026-07-15 09:47:48
First whispered

Public whispers on this page

Text Highlight2026-07-15 13:08:48
Original Highlight Excerpt
"A non-empty comma-separated list of template parameters, used to provide names to the template parameters of a generic lambda"
Whisper Note
Wait, I thought generic lambdas used auto — this is new to me.
Text Highlight2026-07-15 12:59:48
Original Highlight Excerpt
"A non-empty comma-separated list of template parameters, used to provide names to the template parameters of a generic lambda"
Whisper Note
So this is just for naming the template params, not the actual types?
Text Highlight2026-07-15 10:05:48
Original Highlight Excerpt
"Constructs a closure (an unnamed function object capable of capturing variables in scope)."
Whisper Note
I still can't tell if that's better than just writing a normal function.
Text Highlight2026-07-15 09:56:48
Original Highlight Excerpt
"Constructs a closure (an unnamed function object capable of capturing variables in scope)."
Whisper Note
does this mean it's basically a functor but with less typing?
Text Highlight2026-07-15 09:47:48
Original Highlight Excerpt
"Constructs a closure (an unnamed function object capable of capturing variables in scope)."
Whisper Note
so basically a lambda is just a hidden struct with operator()

Share this page's whispers

Share to X
Short link
https://domwhisper.com/s/2e6810c8fb1d
Embed snippet
<iframe src="https://domwhisper.com/embed/2e6810c8fb1d" width="100%" height="480" style="border:0;border-radius:16px" loading="lazy"></iframe>

See what people are discussing on en.cppreference.com

Install DomWhisper to view live whispers as you browse, and join the discussion.

Get the extension