November 2002
Intermediate to advanced
352 pages
6h 58m
English
Along with data abstraction, inheritance and polymorphism form the basic set of tools necessary for object-oriented programming. The implementation of polymorphism in C++ is efficient and flexible but complex.
In this chapter, we'll see how the flexibility offered by C++'s implementation of polymorphism is often abused, and we'll offer guidelines for taming its complexity. Along the way, we'll examine how inheritance and virtual functions are implemented and how that implementation reflects in turn on the C++ language itself.
One of the surest signs of “my first C++ program” is the presence of a type code as a class data member. (I used them in my first C++ program, and they caused me no end of ...
Read now
Unlock full access