Virtual functions and constructors
While an object is under construction or destruction, its type is what it was declared to be:
class Shape {public: // … virtual void draw(); Shape() { draw(); // Shape::draw }};
Previous slide
Next slide
Back to first slide
View graphic version