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



>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]