S
sabarish
Hi to all. Please i can't get information why the Virtual Destructors
and for what purpose they are.
and for what purpose they are.
sabarish said:Hi to all. Please i can't get information why the Virtual Destructors
and for what purpose they are.
sabarish said:Hi to all. Please i can't get information why the Virtual Destructors
and for what purpose they are.
and for what purpose they are.
WittyGuy said:That is without virtual destructor, the base
class destructor alone will be invoked which deletes base class part
alone which is not our intention.
benben said:To properly destroy an object destructors must be called from the outside
in, i.e. from the most derived object towards the base(s) recursively.
Virtual destructor ensures that a call to the destructor from one of the
bases is dispatched to the most derived class's destructor...
Pete said:That is often what happens, but technically the behavior is undefined.
So don't rely on this happening.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.