Re: [gtkmm] GCC 3.3.1 breaks gtkmm



On Thu, Jul 17, 2003 at 10:03:56AM +0200, Erich Schubert wrote:
> > > > > http://bugzilla.gnome.org/show_bug.cgi?id=117494
> > Please help me to make sense of this. Are you saying that the "static_cast
> > chain" problem in gnome bug 117494 already has a solution for debian? If so,
> > I would like to know what it is.
> 
> I posted it in the bug report already.
> I havn't tested it yet, but i think a reinterpret_cast is what you want.
> It compiles fine that way, and my own applications work (but they aren't
> using trees)

No, reinterpret_case is almost never sure the right solution. Checking
Stroustrup reveals the problem is that static_cast can't be used on
polymorphic classes (see pp.413 for 3rd edition). static_cast is dumb,
and doesn't understand RTTI, so can't correctly downcast polymorphic
classes - a dynamic_cast must be used for this case.

Barnaby



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]