Hi Axel, all objects deriving from TObject have virtual destructors, by virtue if ~TObject being virtual. In other cases please give a specific example of a class you want to derive from that does not have a virtual dtor. Cheers, Fons. Axel Naumann wrote: > > Hi, > > Is there a plan to declare (pretty much all) the destructors as virtual? > Assume you have a base class TB and a class TA: public TB, both defining > their own std destructors. > > TB* p = new TA(); > delete p; > > Here the ~TB will be called, NOT the ~TA, as ~TB is not declared virtual. > (At least that's true for the MS compiler, but as it makes sense I'd think > it works for all compilers.) Or is there a reason I can't see for not > declaring them virtual? At least changing this would be "mostly" backwards > compatible... > > Regards, Axel. -- Org: CERN, European Laboratory for Particle Physics. Mail: 1211 Geneve 23, Switzerland E-Mail: Fons.Rademakers@cern.ch Phone: +41 22 7679248 WWW: http://root.cern.ch/~rdm/ Fax: +41 22 7677910
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:43 MET