Created on2015-03-07.00:00:00 last changed109 months ago
Proposed resolution (September, 2015):
Change 7.5.6 [expr.prim.lambda] paragraph 15 as follows:
An entity iscaptured by copy if it is implicitly captured andthecapture-default is= or if it is explicitly capturedwith a capture that is not of the form&identifier or&identifier initializer. For each entity captured bycopy, an unnamed non-static data member is declared in the closuretype. The declaration order of these members is unspecified. The type ofsuch a data member isthe referenced type if the entity is a referenceto an object, an lvalue reference to the referenced function type if theentity is a reference to a function, or the type of the correspondingcaptured entityif the entity is not a reference to an object, or thereferenced typeotherwise.[Note: If the captured entityis a reference to a function, the corresponding data member is also areference to a function. —end note]A member of ananonymous union shall not be captured by copy.
[Adopted at the February, 2016 meeting.]
According to 7.5.6 [expr.prim.lambda] paragraph 15,
An entity is captured by copy if it is implicitly capturedand thecapture-default is= or if it is explicitlycaptured with a capture that is not of the form &identifier or&identifierinitializer. For each entitycaptured by copy, an unnamed non-static data member isdeclared in the closure type. The declaration order of thesemembers is unspecified. The type of such a data member isthe type of the corresponding captured entity if the entityis not a reference to an object, or the referenced typeotherwise.
It's not clear how to handle capture by copy when theentity is an rvalue reference to function. In particular,this appears to be a contradiction with 7.5.6 [expr.prim.lambda] paragraph 3,
An implementation shall not add members of rvalue referencetype to the closure type.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2017-02-06 00:00:00 | admin | set | status: tentatively ready -> cd4 |
| 2015-11-10 00:00:00 | admin | set | messages: +msg5594 |
| 2015-11-10 00:00:00 | admin | set | status: drafting -> tentatively ready |
| 2015-03-07 00:00:00 | admin | create | |