Created on 2013-07-31.00:00:00 last changed 94 months ago
[Moved to DR at the October, 2015 meeting.]
Proposed resolution (May, 2015):
Change 7.5.6 [expr.prim.lambda] paragraph 6 as follows:
The closure type for a non-generic lambda-expression with no lambda-capture has a
public non-virtual non-explicit constconversion function to pointer to function with C++ language linkage (9.11 [dcl.link]) having the same parameter and return types as the closure type's function call operator. The value returned by this conversion function shall be the address of a function that, when invoked, has the same effect as invoking the closure type's function call operator. For a generic lambda with no lambda-capture, the closure type has apublic non-virtual non-explicit constconversion function template to pointer to function. The conversion function template... [Example:auto GL = [](auto a) { std::cout << a; return a; }; int (*GL_int)(int) = GL; // OK: through conversion function template GL_int(3); // OK: same as GL(3)
—end example] The conversion function or conversion function template is public, non-virtual, non-explicit, const, and has a non-throwing exception specification (14.5 [except.spec]).
According to 7.5.6 [expr.prim.lambda] paragraph 6,
The closure type for a non-generic lambda-expression with no lambda-capture has a public non-virtual non-explicit const conversion function to pointer to function with C++ language linkage (9.11 [dcl.link]) having the same parameter and return types as the closure type's function call operator.
This does not specify whether the conversion function is noexcept(true) or noexcept(false). It might be helpful to nail that down.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-02-06 00:00:00 | admin | set | status: dr -> cd4 |
2015-11-10 00:00:00 | admin | set | messages: + msg6068 |
2015-11-10 00:00:00 | admin | set | status: ready -> dr |
2015-05-25 00:00:00 | admin | set | messages: + msg5448 |
2015-05-25 00:00:00 | admin | set | status: drafting -> ready |
2013-10-14 00:00:00 | admin | set | status: open -> drafting |
2013-07-31 00:00:00 | admin | create |