[class.prop] (original) (raw)

11 Classes [class]

11.2 Properties of classes [class.prop]

A trivially copyable class is a class:

A trivial class is a class that is trivially copyable and has one or more eligible default constructors ([class.default.ctor]), all of which are trivial.

[Note 1:

In particular, a trivially copyable or trivial class does not have virtual functions or virtual base classes.

— _end note_]

A class S is a standard-layout class if it:

[Example 1: struct B { int i; }; struct C : B { }; struct D : C { }; struct E : D { char : 4; }; struct Q {};struct S : Q { };struct T : Q { };struct U : S, T { }; — _end example_]

[Note 3:

Standard-layout classes are useful for communicating with code written in other programming languages.

— _end note_]

[Example 2: struct N { int i;int j;virtual ~N();};struct T { int i;private: int j;};struct SL { int i;int j;~SL();};struct POD { int i;int j;}; — _end example_]

A class S is an implicit-lifetime class if