Abstraction Mechanisms, Part 2
- slide 2 : 24
Inheritance: Constructors and destructors
Constructors in class hierarchies work as expected in C++
About constructors
The C++ Programming Language
: Page 306
Constructor rules
A subclass constructor invoke the superclass constructors -
implicitly
or
explicitly
Constructors with parameters must be invoked explicitly
Default constructors can be invoked implicitly
Bottom up construction and top down destruction
First base class constructors, then derived class constructors
Multiple base classes are constructed in their declaration order
Constructors and single inheritance.
Constructors and multiple inheritance.
Constructors and multiple inheritance - implicit activation of default constructor in Base.
Constructors and multiple inheritance - order of construction and destruction.
Constructors and multiple inheritance - order of construction and destruction.