Re: [gtkmm] Replacing dynamic_cast<> with static_cast<> - compiler error.
- From: Paul Davis <pbd op net>
- To: "Paulo Pinto" <pjmlp progtools org>
- Cc: "gtkmm-main" <gtkmm-list gnome org>
- Subject: Re: [gtkmm] Replacing dynamic_cast<> with static_cast<> - compiler error.
- Date: Wed, 18 Sep 2002 10:31:51 -0400
>Right. I know that it doesn't sound pretty but we could replace the
>dynamic_cast with a reinterpret_cast or even an old style cast (ugh
>did I just said that?).
no, you cannot do either of those things.
dynamic_cast is responsible for returning an address that in many/most
cases will be offset from its argument. reinterpret_cast simply
returns the bit pattern of its argument in a form suitable for use as
the type requested. that is completely different from what
dynamic_cast does. an old style cast does the same thing for
pointers.
--p
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]