
14 Feb
2011
14 Feb
'11
3:13 a.m.
[Lorenzo Caminiti]
Why C++0x lambdas don't support constant binding?
Constant binding is instead supported by Boost.Local. I looked over N2550, N2529, etc but I could only see binding by value and reference and not by constant value and constant references?! I must be missing something...
By default, lambdas' function call operators are const, so variables captured by copy can't be modified. Of course, this doesn't affect variables captured by reference. N3225 5.1.2 [expr.prim.lambda]/5: "This function call operator is declared const (9.3.1) if and only if the lambda-expression's parameter-declaration-clause is not followed by mutable." Stephan T. Lavavej Visual C++ Libraries Developer