1.

I Have A Class That Is Derived From Three Base Classes. Can I Insure That One Base Class Constructor Will Be Called Before All Other Constructors?

Answer»

If you declare the BASE class as a virtual base class, its CONSTRUCTOR will be called before any non-virtual base class CONSTRUCTORS. Otherwise the constructors are called in left-to-right order on the DECLARATION line for the class.

If you declare the base class as a virtual base class, its constructor will be called before any non-virtual base class constructors. Otherwise the constructors are called in left-to-right order on the declaration line for the class.



Discussion

No Comment Found