Chapter 10. OOP: Inheritance and Runtime Polymorphism

Images

Objectives

In this chapter, you’ll:

Use traditional and modern inheritance idioms, and understand base classes and derived classes.

Understand the order in which C++ calls constructors and destructors in inheritance hierarchies.

See how runtime polymorphism can make programming more convenient and systems more easily extensible.

Use override to tell the compiler that a derived-class function overrides a base-class virtual function.

Use final at the end of a function’s prototype to indicate that function may not be overridden.

Use final after a class’s name in its definition to ...

Get C++20 for Programmers, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.