Created on 2015-03-07.00:00:00 last changed 94 months ago
Proposed resolution (September, 2015):
Change 7.5.6 [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 is not of the form & identifier or & identifier initializer. For each entity captured by copy, an unnamed non-static data member is declared in the closure type. The declaration order of these members is unspecified. The type of such a data member is the referenced type if the entity is a reference to an object, an lvalue reference to the referenced function type if the entity is a reference to a function, or the type of the corresponding captured entityif the entity is not a reference to an object, or the referenced typeotherwise.[Note: If the captured entity is a reference to a function, the corresponding data member is also a reference to a function. —end note]A member of an anonymous 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 captured and the capture-default is = or if it is explicitly captured with a capture that is not of the form & identifier or & identifier initializer. For each entity captured by copy, an unnamed non-static data member is declared in the closure type. The declaration order of these members is unspecified. The type of such a data member is the type of the corresponding captured entity if the entity is not a reference to an object, or the referenced type otherwise.
It's not clear how to handle capture by copy when the entity 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 reference type 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 |