Lecture 4 - Page 2 : 24
Notes about C++
Abstraction Mechanisms, Part 2
Inheritance in C++
Inheritance: Constructors and destructors
Inheritance: Copying and slicing
Member access control: private, public and protected
Virtual Functions
Destructors and Inheritance - Virtual Destructors
Hiding inherited names
Abstract Classes
What about interfaces in C++?
What about nested classes in C++?
What about prevention of derivation in C++
Pointer to members
Multiple inheritance - issues and C++ solutions
Multiple inheritance - issues and C++ solutions
Multiple inheritance: Ambiguities
Replicated base class
Is repeated inheritance possible?
Is repeated inheritance possible? No!
Shared base class: Virtual base
Base class access
Base class access
Base class access - the C++ rules
Base class access - Examples
Discussion: No single most general class in C++
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.