A
ashaniray
Hi,
The ISO-C++ spec says that the order of construction for C++ objects
is:
****************************************************************
....
Initialization shall proceed in the following order:
* First, and only for the constructor of the most derived class as
described below, virtual base classes shall be 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 class names in the derived class
base-specifier-list.
* Then, direct base classes shall be initialized in declaration
order as they appear in the base-specifier-list (regardless of the
order of the mem-initializers).
.....
*************************************************************
Can someone clarify the algorithm with a non-trivial example ?
ashani
The ISO-C++ spec says that the order of construction for C++ objects
is:
****************************************************************
....
Initialization shall proceed in the following order:
* First, and only for the constructor of the most derived class as
described below, virtual base classes shall be 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 class names in the derived class
base-specifier-list.
* Then, direct base classes shall be initialized in declaration
order as they appear in the base-specifier-list (regardless of the
order of the mem-initializers).
.....
*************************************************************
Can someone clarify the algorithm with a non-trivial example ?
ashani