Part 4: Advanced uses of C++
The last part of the book discusses advanced uses of the C++ language: virtual functions, abstract classes, advanced overloaded operators, templates, exceptions, special casts, and run-time identification information.
Chapter 15, "Virtual Functions and Other Advanced Uses of Inheritance," describes the implementation of polymorphism with virtual functions—another jewel of object-oriented programming. First, it introduces the necessary (and often counterintuitive) background material on safe and unsafe type conversions between related and nonrelated classes. Then it applies this material to the task of processing heterogeneous lists of objects that belong to different (but related) classes and perform the same operation ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access