I have a basic syntax question. I am trying to understand the meaning of an operator within square brackets when used in an assignment. E.g.
a = [&] (const std::string&) { ... };
a = [=] (const std::string& b) { ... };
Thanks,
I have a basic syntax question. I am trying to understand the meaning of an operator within square brackets when used in an assignment. E.g.
a = [&] (const std::string&) { ... };
a = [=] (const std::string& b) { ... };
Thanks,
They distinguish between capturing variables by reference ([&]) or by value ([=]) in closures. See http://en.cppreference.com/w/cpp/language/lambda for details.