Movatterモバイル変換


[0]ホーム

URL:


This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-04-13


2542. Is a closure type a structural type?

Section:7.5.6.2  [expr.prim.lambda.closure]    Status:DRWP    Submitter:Zhihao Yuan    Date:2022-03-01

[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 publicor private. This makes a difference, since it affects whether aclosure type is a structural type or not(13.2 [temp.param] paragraph 7:

Astructural type is one of the following:

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.5.2 [dcl.init.aggr])and not a structural type(13.2 [temp.param]). ...



[8]ページ先頭

©2009-2025 Movatter.jp