Movatterモバイル変換


[0]ホーム

URL:


Issue 1359 - WG21 CWG Issues
Title
constexpr union constructors
Status
cd3
Section
9.2.6 [dcl.constexpr]
Submitter
Richard Smith

Created on2011-08-16.00:00:00 last changed145 months ago

Messages

msg4141 (view)
Date: 2012-10-15.00:00:00

[Moved to DR at the October, 2012 meeting.]

msg3716 (view)
Date: 2012-02-15.00:00:00

Proposed resolution (February, 2012):

Change 9.2.6 [dcl.constexpr] paragraph 4 as follows:

In a definition of aconstexpr constructor, each of theparameter types shall be a literal type. In addition, either itsfunction-body shall be= delete or= defaultor it shall satisfy the following constraints:

  • ...

  • everynon-variant non-static data member and base classsub-object shall be initialized (11.9.3 [class.base.init]);

  • if the class is a non-empty union, or for each non-emptyanonymous union member of a non-union class, exactly one non-staticdata member shall be initialized;

  • ...

msg3528 (view)
Date: 2011-08-16.00:00:00

Aconstexpr constructor is required to initialize allnon-static data members (9.2.6 [dcl.constexpr] paragraph 4),which conflicts with the requirement that a constructor for a unionis permitted to initialize only a single non-static data member(11.9.3 [class.base.init] paragraph 8).

History
DateUserActionArgs
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-05-03 00:00:00adminsetstatus: dr -> drwp
2012-11-03 00:00:00adminsetmessages: +msg4141
2012-11-03 00:00:00adminsetstatus: ready -> dr
2012-02-27 00:00:00adminsetmessages: +msg3716
2012-02-27 00:00:00adminsetstatus: drafting -> ready
2011-08-16 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp