- Title
- Move-construction of reference members of closure objects
- Status
- cd2
- Section
- 7.5.6.2 [expr.prim.lambda.closure]
- Submitter
- Jonathan Caves
Created on 2009-02-09.00:00:00 last changed 199 months ago
Messages
Date: 2009-07-15.00:00:00
[Voted into the WP at the July, 2009 meeting as part of N2927.]
Date: 2009-07-15.00:00:00
Proposed resolution (July, 2009) See document PL22.16/09-0117 = WG21 N2927.
Date: 2009-02-09.00:00:00
According to 7.5.6 [expr.prim.lambda] paragraph 11, the closure
class “has a public move constructor that performs a
member-wise move.” Although the terms “move
constructor” and “member-wise move” are not currently
defined (see issue 680), this presumably
means that a lambda like [&i]{} results in a closure class
similar to: This constructor is ill-formed because it attempts to initialize
an lvalue reference to non-const int with the rvalue returned by
std::move . It is not clear whether this should be handled by: Not generating the move constructor. Generating the declaration of the move constructor but only
defining it (and giving the corresponding error) if the move
constructor would be used, similar to the handling of other
implicitly-defined special member functions.
class F {
int& i;
public:
F(&& other):
i(std::move(other.i)) { }
// etc.
};
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2010-03-29 00:00:00 | admin | set | status: wp -> cd2 |
| 2009-11-08 00:00:00 | admin | set | status: dr -> wp |
| 2009-08-03 00:00:00 | admin | set | messages: + msg2246 |
| 2009-08-03 00:00:00 | admin | set | status: review -> dr |
| 2009-03-23 00:00:00 | admin | set | messages: + msg1914 |
| 2009-02-09 00:00:00 | admin | create | |