Created on 2013-03-04.00:00:00 last changed 20 months ago
Notes from the April, 2013 meeting:
CWG agreed with the intent of this issue.
[Accepted as a DR as part of paper P0588R1 at the October, 2017 meeting.]
According to 7.5.5 [expr.prim.lambda] paragraph 9,
A lambda-expression whose smallest enclosing scope is a block scope (6.4.3 [basic.scope.block]) is a local lambda expression; any other lambda-expression shall not have a capture-list in its lambda-introducer. The reaching scope of a local lambda expression is the set of enclosing scopes up to and including the innermost enclosing function and its parameters.
Consequently, lambdas appearing in mem-initializers and brace-or-equal-initializers cannot have a capture-list. However, these expressions are evaluated in the context of the constructor and are permitted to access this and non-static data members.
Should the definition of a local lambda be modified to permit capturing lambdas within these contexts?
|2020-12-15 00:00:00||admin||set||status: open -> cd5|
|2013-05-03 00:00:00||admin||set||messages: + msg4358|