I saw a piece of code like this:
Foo(
[&](int a){
...
}
);
Seems like an inner function, but why there is a [&]
?
I saw a piece of code like this:
Foo(
[&](int a){
...
}
);
Seems like an inner function, but why there is a [&]
?
This is a lambda, the [&]
means that:
captures all automatic variables mentioned in the body of the lambda by reference