Created on 2013-09-23.00:00:00 last changed 81 months ago
Proposed resolution (September, 2013):
For every init-capture a non-static data member named by the identifier of the init-capture is declared in the closure type. This member is not a bit-field and not mutable. The type of that member corresponds to the type of a hypotheticalvariable declarationof the form “auto init-capture ;” , except that the variable name (i.e., the identifier of the init-capture) is replaced by a unique identifier.
[Note: This enables an init-capture like “x = std::move(x)”; the second “x” must bind to a declaration in the surrounding context. —end note]
No entity is captured by an init-capture. Within the lambda-expressions lambda-declarator and compound-statement, the identifier in the init-capture hides any declaration of the same name in scopes enclosing the lambda-expression.[Example:...
Change 7.5.5 [expr.prim.lambda] paragraph 15 as follows:
An entity is captured by copy if it is implicitly captured and the capture-default is = or if it is explicitly captured with a capture that
does not include an &. For each entity...
Change 7.5.5 [expr.prim.lambda] paragraph 18 as follows:
Every id-expression that is an odr-use (6.3 [basic.def.odr]) of an entity captured by copy is transformed into an access to the corresponding unnamed data member of the closure type. [Note:...
This resolution also resolves issue 1681.
[Applied to WP at the February, 2014 meeting.]
The access of the non-static data member corresponding to an init-capture is not specified. The question would be moot if the member were unnamed like the other non-static data members of the closure class.
|2014-11-24 00:00:00||admin||set||status: accepted -> c++14|
|2014-03-03 00:00:00||admin||set||status: ready -> accepted|
|2013-10-14 00:00:00||admin||set||messages: + msg4579|