Start here · Essential guide
C++ Lambda Functions With Examples
How to write C++ lambda functions, capture variables from the surrounding code and use lambdas with the standard library, with short examples.
Syntax and Functions
How C++ lambdas are written, what type they have and why they are useful.
Start here · Essential guide
How to write C++ lambda functions, capture variables from the surrounding code and use lambdas with the standard library, with short examples.
In math, λ is a Greek letter used for many things, and in lambda calculus it marks an anonymous function, which is where the programming term comes from.
What the => arrow means in C#: the lambda arrow in expressions like x => x * 2, expression-bodied members and switch expressions, compared with C++.
Every C++ lambda has its own unnamed type, so you usually store one with auto or std::function. Here is what that means, with a short example.
Why lambda functions are useful: they let you write a small piece of code where you use it, pass it to algorithms and capture local values, with examples.
Related topics