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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With