Seeing other answers without to much details into other members initialization I recommend reading more info from standard reference 12.6.2 section 13 (thanks @Adam Getchell for link):
In a non-delegating constructor, initialization proceeds in the following order:
(13.1) — First, and only for the constructor of the most derived class (1.8),
virtual base classes are initialized in
the order they appear on a depth-first left-to-right traversal of the directed acyclic graph of base classes,
where “left-to-right” is the order of appearance of the base classes in the derived class base-specifier-list.
(13.2) — Then, direct base classes are initialized in declaration order
as they appear in the base-specifier-list
(regardless of the order of the mem-initializers).
(13.3) — Then, non-static data members are initialized
in the order they were declared in the class definition
(again regardless of the order of the mem-initializers).
(13.4) — Finally, the compound-statement of the constructor body is executed.
Terminology:
base-specifier-list
- list of base classes for derived class. See section 10 of reference.
Example: class A :
public virtual B, private C
mem-initializers
- list of initializers for members of your class.
Example: A::A() :
number(1.0f), text("abc")
{ /* ... */}
compound-statement
- block of {}
, i.e. body of constructor.
That's all, simply said the order:
- static variables (see this stackoverflow question C++ static variables initialization order, also that interesting behavior SIOF). In single translation unit order follows declaration order, in different - compilers decide.
- virtual base classes as appear by dfs
- direct base classes as specified by order in deriving list
- non-static variables by declaration (! not initializers order) order