Created on 2023-12-29.00:00:00 last changed 5 months ago
Proposed resolution (approved by CWG 2024-02-02):
Change in 7.5.6.2 [expr.prim.lambda.closure] paragraph 3 as follows:
The closure type is not an aggregate type (9.4.2 [dcl.init.aggr])and not; it is a structural type (13.2 [temp.param]) if and only if the lambda has no lambda-capture. An implementation may define the closure type differently from ...
Change in 13.6 [temp.type] paragraph 2 as follows:
Two values are template-argument-equivalent if they are of the same type and
- ...
- they are of a closure type (7.5.6.2 [expr.prim.lambda.closure]), or
- they are of class type and their corresponding direct subobjects and reference members are template-argument-equivalent.
[Accepted as a DR at the March, 2024 meeting.]
Issue 2542 (approved in June, 2023) made all closure types not be structural types, i.e. unsuitable for use as non-type template parameters. This causes an inconsistency with the treatment of the pointer-to-function conversion for closure types with no captures:
template <auto V> void foo() {} void bar() { foo<[i = 3] { return i; }>(); // #1: error foo<[]{}>(); // #2: error foo<+[]{}>(); // #3: OK, a function pointer is a structural type }
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-07-20 13:52:34 | admin | set | status: dr -> drwp |
2024-04-05 21:43:46 | admin | set | status: ready -> dr |
2024-03-20 14:10:31 | admin | set | status: tentatively ready -> ready |
2024-02-02 23:59:16 | admin | set | messages: + msg7585 |
2024-02-02 23:59:16 | admin | set | status: review -> tentatively ready |
2024-01-21 13:30:12 | admin | set | status: open -> review |
2023-12-29 00:00:00 | admin | create |