3 ms·
I have been testing this, and I'm not convinced. A lambda with no capture at all (just []) will not compile if it accesses any variable in the scope of the lamb
by hellofunk 10y ago
I have been testing this, and I'm not convinced. A lambda with no capture at all (just []) will not compile if it accesses any variable in the scope of the lambda definition (including globals). I must add [=] or similar to get access to them. What were you referring to?
The compiler error is clear: "variable 'lam' cannot be implicitly captured in a lambda with no capture-default specified"