Re: Delete a class with multiple inheritance through base pointer?
From: Chris Theis (Christian.Theis_at_nospam.cern.ch)
Date: 02/12/04
- Next message: Ivan Vecerina: "Re: "new" vs "new class""
- Previous message: Chris Theis: "Re: next ISO/ANSI standard for C++"
- In reply to: Ian: "Re: Delete a class with multiple inheritance through base pointer?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 12 Feb 2004 12:23:41 +0100
"Ian" <noone@nowhere.com> wrote in message
news:402B3CCB.6040308@nowhere.com...
> John Harrison wrote:
> > "Ian" <noone@nowhere.com> wrote in message
> > news:402B2AFC.9010906@nowhere.com...
> >
> >>I left out the virtual destructors in A and B...
> >>
> >>Should work, but I am seeing problems where it does not.
> >>
> >
> >
> > What problems are you seeing?
> >
> What I think is a compiler bug.... Members of one base being invalid in
> the destructor of the derived class.
>
Could you elaborate on that (probably with some sample code & which compiler
you're using). From your code I do not see a problem (with the virtual
declartions being added) as the order of destruction is simply the reverse
order of construction. Thus the dtor of the derived class is called before
the one of the base class.
Regards
Chris
- Next message: Ivan Vecerina: "Re: "new" vs "new class""
- Previous message: Chris Theis: "Re: next ISO/ANSI standard for C++"
- In reply to: Ian: "Re: Delete a class with multiple inheritance through base pointer?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|