Constructors and Destructors
- Constructors (including Copy Constructor):
- Derived class constructor implementation should call parent class constructor
- Make call explicit in initialization list
- Calling order: bottom-up
- Execution order: top-down
- Destructors:
- No explicit call to base class destructor
- Called automatically as variable departs scope
- Calling order: bottom-up
- Execution order: bottom-up
- Code Example
|