H
heted7
Hi,
Most of the books on C++ say something like this: "A virtual destructor
should be defined if the class contains at least one virtual member
function."
My question is: why is it only for the case when the class contains at
least one virtual member function? Shouldn't the destructor always be
virtual, whenever there's a possibility that an inherited object will
be destructed through a base class pointer? (This does not require,
that the base class have any other virtual function!)
Thanks!
ps: can someone please explain me briefly, why a concrete base class
cannot have an abstract derived class?
Most of the books on C++ say something like this: "A virtual destructor
should be defined if the class contains at least one virtual member
function."
My question is: why is it only for the case when the class contains at
least one virtual member function? Shouldn't the destructor always be
virtual, whenever there's a possibility that an inherited object will
be destructed through a base class pointer? (This does not require,
that the base class have any other virtual function!)
Thanks!
ps: can someone please explain me briefly, why a concrete base class
cannot have an abstract derived class?