POV-Ray : Newsgroups : povray.off-topic : Wahahahaha! : Re: Wahahahaha! Server Time
11 Oct 2024 17:46:05 EDT (-0400)
  Re: Wahahahaha!  
From: Darren New
Date: 11 Nov 2007 17:40:46
Message: <473784ee$1@news.povray.org>
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> Most other languages don't futz with the class of the object while it's 
>> being constructed, so it doesn't really come up, I guess. One of the 
>> costs of multiple inheritance as implemented by C++?
> 
>   I don't understand what multiple inheritance has to do with this.

The need for multiple vtables in the final class.  Well, it's not 
specifically multiple inheritance, but rather the fact that vtables are 
indexed with fixed indecies for virtual functions, which means you have 
to modify the base pointer if you have more than one parent class.

If you only have one chain of inheritance, then the virtual functions in 
child classes can always come after the virtual functions in parent 
classes without conflict. If you have multiple inheritance, two parent 
classes might assign the same index to two different virtual functions, 
and something that inherits from both needs to disambiguate.

-- 
   Darren New / San Diego, CA, USA (PST)
     Remember the good old days, when we
     used to complain about cryptography
     being export-restricted?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.