[haiku-commits] Re: r38086 -DA haiku/trunk/src/servers/app/drawing/Painter

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 13 Aug 2010 16:26:06 +0200

Rene Gollent <anevilyak@xxxxxxxxx> wrote:
> On Fri, Aug 13, 2010 at 9:46 AM, pulkomandy
> <pulkomandy@xxxxxxxxxxxxxxxxx> wrote:
> > Why so ? From my understanding, one should use dynamic_cast only 
> > when
> > not sure about the type of the object, as dynamic_cast performs a
> Incorrect, dynamic_cast may also adjust the pointer in order to deal
> with various complexities of multiple inheritance since, depending on
> which type you're casting to you may need to be referencing a
> different vtable.

Actually, I would argue that the change was right. static_cast must be 
able to deal with multiple inheritance just as well, and since it's 
already clear that the type is linear, and the result is not checked 
afterwards, a static_cast is what should be there.

Bye,
   Axel.


Other related posts: