Created on 2009-02-06.00:00:00 last changed 179 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.
According to 7.5.6 [expr.prim.lambda] paragraph 7, the appearance of a lambda expression results in the definition of a class “considered to be defined at the point where the lambda expression occurs.” It is not clear whether that means that a lambda expression cannot appear at any point where it is not permitted to define a class type. For example, 9.3.4.6 [dcl.fct] paragraph 10 says, “Types shall not be defined in return or parameter types.” Does that mean that a function declaration like
void f(int a[sizeof ([]{ return 0; })]);
is ill-formed, because the parameter type defines the closure class for the lambda expression? (Issue 686 lists many contexts in which type definitions are prohibited. Each of these should be examined to see whether a lambda expression should be allowed or prohibited there.)
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: + msg2242 |
2009-08-03 00:00:00 | admin | set | status: review -> dr |
2009-03-23 00:00:00 | admin | set | messages: + msg1906 |
2009-03-23 00:00:00 | admin | set | status: open -> review |
2009-02-06 00:00:00 | admin | create |