Re: [gtkmm] GCC 3.3.1 breaks gtkmm
- From: Barnaby Gray <bee pickle me uk>
- To: Erich Schubert <erich schubert mucl de>
- Cc: Murray Cumming Comneon com, chris cvine freeserve co uk, gtkmm-list gnome org, 199102 bugs debian org
- Subject: Re: [gtkmm] GCC 3.3.1 breaks gtkmm
- Date: Thu, 17 Jul 2003 19:27:36 +0100
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]