Created on 2009-01-22.00:00:00 last changed 178 months ago
[Voted into the WP at the July, 2009 meeting as part of N2927.]
Proposed resolution (July, 2009)
See document PL22.16/09-0117 = WG21 N2927. (The question regarding the failure of 7.6.1.4 [expr.type.conv] failing to categorize T() as a temporary was split off into a separate issue; see issue 943.)
The specification of closure objects is missing a couple of important points regarding their destruction. First, although 7.5.6 [expr.prim.lambda] paragraph 11 mentions other implicitly-declared special member functions, it is silent on the destructor, leading to questions about whether the closure class has one or not.
Second, nothing is said about the timing of the destruction of a closure object: is it normally destroyed at the end of the full-expression to which the lambda expression belongs, and is its lifetime extended if the closure object is bound to a reference? These questions would be addressed if paragraph 2 defined the closure object as a temporary instead of just as an rvalue. (It should be noted that 7.6.1.4 [expr.type.conv] also does not define the conceptually-similar T() as a temporary.)
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: + msg2237 |
2009-08-03 00:00:00 | admin | set | status: review -> dr |
2009-03-23 00:00:00 | admin | set | messages: + msg1901 |
2009-03-23 00:00:00 | admin | set | status: open -> review |
2009-01-22 00:00:00 | admin | create |