[haiku-development] Re: destructor and virtual functions
- From: Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
- To: haiku-development@xxxxxxxxxxxxx
- Date: Fri, 07 Mar 2008 23:06:25 +0100
Hi,
On 2008-03-07 at 22:30:45 [+0100], Rene Gollent <anevilyak@xxxxxxxxx> wrote:
> On Fri, Mar 7, 2008 at 3:24 PM, Stephan Assmus <superstippi@xxxxxx> wrote:
> > What happens if I call a virtual function from within the destructor of a
> > base class? Will I always get the base class version of the function?
> >
>
> Nope, you'd have to explicitly say baseclassname::function() if you
> want the base version to my awareness.
I have not checked with the standard, but I'd assume that from a destructor
you can only reach methods from that class "upwards", as all the subclasses
are already destroyed (their destructors were already executed).
So I'd think that calling a method from a base class' destructor should
invoke the implementation in that base class, not in any subclass of it. Just
as it in the constructor, I suppose.
cheers,
Oliver
- Follow-Ups:
- [haiku-development] Re: destructor and virtual functions
- From: Rene Gollent
- [haiku-development] Re: destructor and virtual functions
- From: Gabriele Biffi
- References:
- [haiku-development] destructor and virtual functions
- From: Stephan Assmus
- [haiku-development] Re: destructor and virtual functions
- From: Rene Gollent
Other related posts:
- » [haiku-development] destructor and virtual functions
- » [haiku-development] Re: destructor and virtual functions
- » [haiku-development] Re: destructor and virtual functions
- » [haiku-development] Re: destructor and virtual functions
- » [haiku-development] Re: destructor and virtual functions
- » [haiku-development] Re: destructor and virtual functions
- [haiku-development] Re: destructor and virtual functions
- From: Rene Gollent
- [haiku-development] Re: destructor and virtual functions
- From: Gabriele Biffi
- [haiku-development] destructor and virtual functions
- From: Stephan Assmus
- [haiku-development] Re: destructor and virtual functions
- From: Rene Gollent