Re: Virtual destructors are unique virtuals right

From: Andre Kostur (nntpspam_at_kostur.net)
Date: 03/24/04


Date: Wed, 24 Mar 2004 16:19:53 GMT


"Siemel Naran" <SiemelNaran@REMOVE.att.net> wrote in
news:hZc8c.13360$tY6.381457@bgtnsc04-news.ops.worldnet.att.net:

> "Howard" <alicebt@hotmail.com> wrote in message
> news:c3qh26$qnu@dispatch.concentric.net...
>> "John Cho" <johncho@johncho.us> wrote in message
>> Not exactly. The destructor of a derived class does not call the
> destructor
>> of its base class, regardless of whether the base class has a virtual
>> destructor.
>
> I disagree. The derived class destructor always calls the base class
> destructor.

Difference of terminology (and mechanism), I think. I prefer to say that
the derived class' destructor "chains back" to the base class' destructor.



Relevant Pages

  • Re: Virtual destructors are unique virtuals right
    ... The destructor of a derived class does not call the ... >> of its base class, regardless of whether the base class has a virtual ... constructor for the BaseClass, then calls the constructor for the ... DerivedClass. ...
    (comp.lang.cpp)
  • Re: virtual destructor
    ... To get a base class pointer to call a derived class method, ... if the Derived Class constructor creates resources. ... If the base class destructor is NOT virtual, ...
    (comp.lang.cpp)
  • Re: Inheriting from STL bitset
    ... > baseclass destructor explicitly in my derived class? ... Virtual destructor is needed when you delete an object ... of derived class using a base class pointer. ...
    (comp.lang.cpp)
  • Re: Odd behavior, vector member, MFC and consol app
    ... someone call the base class destructor which then ended up doing something bad. ... it should have no virtual functions at all. ... A good clue that a class is not intended for derivation is the absence ...
    (microsoft.public.vc.mfc)
  • derived class destructors
    ... When the destructor of a derived class is called, ... of the base class is automatically called at the end. ... Simon Fraser University ...
    (microsoft.public.vc.language)