- Title
- Lambda capture in member initializers
- Status
- cd5
- Section
- 7.5.6.3 [expr.prim.lambda.capture]
- Submitter
- Vinny Romano
Created on 2013-03-04.00:00:00 last changed 69 months ago
Messages
Date: 2013-04-15.00:00:00
Notes from the April, 2013 meeting: CWG agreed with the intent of this issue.
Date: 2017-10-15.00:00:00
[Accepted as a DR as part of paper P0588R1 at the
October, 2017 meeting.] According to 7.5.6 [expr.prim.lambda] paragraph 9, 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?
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.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2020-12-15 00:00:00 | admin | set | status: open -> cd5 |
| 2013-05-03 00:00:00 | admin | set | messages: + msg4358 |
| 2013-03-04 00:00:00 | admin | create | |