1 : 2] = {}; f(x, selector); // OK: is a dependent expression, so captures x }; auto g3 = [=](auto a) { typeid(a + x); // captures x regardless of // whether a + x is an unevaluated operand }; constexpr Noncopy
The lambda expression is a prvalueprue rvalueexpression whose value is whose result object is an unnamed temporary object of unique unnamed non-union non-aggregate(非集合) class type, known as closure type, which is declared (for the purposes of ADL) in the smallest block scope, class scope...
Finally, the body expression is evaluated in the local environment. Lambda We could hardly claim that the Fexpr Vau is the ultimate Lambda without showing how to implement Lambda. Now that we’ve made evaluation explicit, Lambda can be described as an applicative wrapper (evaluating operands to...