C++ Lambda
In C++11 and later, a lambda expression—often called a lambda—is a convenient way of defining an anonymous function object (a closure) right at the location where it’s invoked or passed as an argument to a function.
- MSDN
[capture](parameters) -> return_type { function_body }
- capture clause (Also known as the lambda-introducer in the C++ specification.)
- parameter list Optional. (Also known as the lambda declarator)
- mutable specification Optional.
- exception-specification Optional.
- trailing-return-type Optional.
- lambda body.
Capture clause
[] it means that you will not provide anything to give to lambda.
[&] it is used to say that you have some references to mess with.
[=] it is used to make the copy.
[this] is used to the enclosing class.