Ditto for virtual destructors.) Figure 1: The storage layout of a shape object if class shape had no virtual functions. C++ compilers don't create vptrs and vtbls unless needed. Thus, non-polymorphic ...
Each class in a hierarchy of polymorphic objects should have a function that initializes its vptr properly. For much of this year, I've been discussing polymorphic types and virtual functions. I ...