Initialization Order of Bases and Members

Base classes and member objects are initialized in the following order:

  1. Virtual base classes are initialized in the order in which they appear in the directed acyclic graph. For information about using the directed acyclic graph to construct a list of unique subobjects, see Virtual Base Classes in Chapter 9. (Note that these subobjects are destroyed by walking the same list in reverse.) For more information about how the directed acyclic graph is traversed, see Order of Destruction.

  2. Nonvirtual base classes are initialized in the order in which they are declared in the class declaration.

  3. Member objects are initialized in the order in which the objects are declared in the class.

The order in which base classes and member objects are initialized is not affected by the order in which the member initializers or base-class initializers appear in the member-initializer-list of the constructor.