12 Object-Oriented Programming: Polymorphism

Objectives

In this chapter you’ll:

  • See how polymorphism makes programming more convenient and systems more extensible.

  • Understand the relationships among objects in an inheritance hierarchy.

  • Use C++11’s overrides keyword when overriding a base-class virtual function in a derived class.

  • Use C++11’s default keyword to autogenerate a virtual destructor.

  • Use C++11’s final keyword to indicate that a base-class virtual function cannot be overridden.

  • Create an inheritance hierarchy with both abstract and concrete classes.

  • Determine an object’s type at runtime using runtime type information (RTTI), dynamic_cast, typeid and type_info.

  • Understand how C++ can implement virtual functions and dynamic binding. ...

Get C++ How to Program, 10/e now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.