Movatterモバイル変換


[0]ホーム

URL:


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

2025-12-20


1813. Direct vs indirect bases in standard-layout classes

Section:Clause 11  [class]    Status:CD4    Submitter:Daveed Vandevoorde    Date:2013-11-20

[Moved to DR at the November, 2014 meeting.]

One of the criteria for a standard-layout class inClause 11 [class] paragraph 7 is:

In an example like

  struct B { int i; };  struct C : B { };  struct D : C { };

this could be read as indicating thatD is not astandard-layout class, since it has two base classes, one directand one indirect, that each have a non-static data member. Theintent should be clarified.

See alsoissue 1881 for a relatedquestion about standard-layout classes.

Proposed resolution (June, 2014):

Change Clause 11 [class] paragraph 7 as follows:

Astandard-layout class is a class that:

[Example:

   struct B { int i; };         // standard-layout class   struct C : B { };            // standard-layout class   struct D : C { };            // standard-layout class   struct E : D { char : 4; };  // not a standard-layout class   struct Q {};   struct S : Q { };   struct T : Q { };   struct U : S, T { };         // not a standard-layout class

end example]

This resolution also resolvesissue 1881.

(See also the related changes in the resolution ofissue 1672.)




[8]ページ先頭

©2009-2026 Movatter.jp