Created on 2022-03-01.00:00:00 last changed 11 months ago
Proposed resolution (approved by CWG 2023-03-30):
Change in 7.5.6.2 [expr.prim.lambda.closure] paragraph 2 as follows:
... The closure type is not an aggregate type (9.4.2 [dcl.init.aggr]) and not a structural type (13.2 [temp.param]). ...
[Accepted as a DR at the June, 2023 meeting.]
Consider:
template <auto V> void foo() {} void bar() { foo<[i = 3] { return i; }>(); }
It is unclear whether the data members of a closure type are public or private. This makes a difference, since it affects whether a closure type is a structural type or not (13.2 [temp.param] paragraph 7:
A structural type is one of the following:
- a scalar type, or
- an lvalue reference type, or
- a literal class type with the following properties:
- all base classes and non-static data members are public and non-mutable and
- the types of all bases classes and non-static data members are structural types or (possibly multi-dimensional) array thereof.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-12-19 10:15:28 | admin | set | status: dr -> drwp |
2023-07-16 13:00:43 | admin | set | status: ready -> dr |
2023-03-31 21:45:01 | admin | set | messages: + msg7242 |
2023-03-31 21:45:01 | admin | set | status: drafting -> ready |
2022-11-20 07:54:16 | admin | set | status: open -> drafting |
2022-03-01 00:00:00 | admin | create |