[Solved] what is & mean in c++ lambda?


[&](int n) {} means that in the lambda block you capture every variable from the scope by reference in contrast for example to [=](int n) {} where you have an access by value. You could also specify excactly what variable you need to be passed by reference or by value [&a, b](int n) {}

PS. Have a look on: http://en.cppreference.com/w/cpp/language/lambda

2

solved what is & mean in c++ lambda?