© Ivor Horton and Peter Van Weert 2020
I. Horton, P. Van WeertBeginning C++20https://doi.org/10.1007/978-1-4842-5884-2_15

15. Polymorphism

Ivor Horton1  and Peter Van Weert2
(1)
Stratford-upon-Avon, Warwickshire, UK
(2)
Kessel-Lo, Belgium
 

Polymorphism is such a powerful feature of object-oriented programming that you’ll use it in the majority of your C++ programs. Polymorphism requires you to use derived classes, so the content of this chapter relies heavily on the concepts related to inheritance in derived classes that we introduced in the previous chapter.

In this chapter, you’ll learn
  • What polymorphism is and how you get polymorphic behavior with your classes

  • What a virtual function is

  • What function overriding is and how this differs from function overloading ...

Get Beginning C++20: From Novice to Professional 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.