Re: [gtkmm] Replacing dynamic_cast<> with static_cast<> - compiler error.



Sorry for the naive question, but what is
the relation between `Glib::ObjectBase *'
and `Atk::Object *' ?

--
Paulo Pinto

----- Original Message -----
From: "Murray Cumming" <murrayc usa net>
To: "gtkmm-list" <gtkmm-list gnome org>
Sent: Wednesday, September 18, 2002 11:20 AM
Subject: [gtkmm] Replacing dynamic_cast<> with static_cast<> - compiler
error.


> I'm experimenting with changing the dynamic_cast<>s in the default
> signal handlers with static_cast<>s to avoid the
> dynamic-cast-during-constructor gcc2.9* bug.
>
> But I'm getting this error:
>
> Atk::Object_Class::children_changed_callback (AtkObject *, unsigned
> int, void *)':
> object.cc:229: invalid static_cast from type `Glib::ObjectBase *' to
> type `Atk::Object *'
>
> I can't understand why. I think I remember it being something do with
> Multiple Inheritance and/or virtual base classes. Can someone explain it
> to me again? I have attached the patch that produces this error.
>
> Here is my code comment, but I don't understand it anymore:
>  dnl  We have to use a dynamic_cast because we do not
>  dnl  know the actual type from which to cast up.
>
> I suspect that this is some normal C++ thing. I seem to remember that we
> should be able to use static_cast<> in some places and dynamic_cast<> in
> others. I think I was just being lazy when writing the code generator.
>
> --
> Murray Cumming
> murrayc usa net
> www.murrayc.com
>




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