c++ - Pure virtual call in destructor of most derived class -
i know shouldn't call virtual function in ctor or dtor of base class, of derived class? should fine right? e.g.
class base { ... virtual void free() = 0; }; class child : public base { ... free() {/* free memory */} ~child() {free();} };
well, can it, dynamic type of *this
inside child::~child()
child
, , not more derived. when have further derived class class foo : child
overrides free()
, overridden function not called.
Comments
Post a Comment