[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: dynamic_cast performance overhead
From:       Richard Smith <kde () metafoo ! co ! uk>
Date:       2005-06-02 20:19:55
Message-ID: 200506022119.55842.kde () metafoo ! co ! uk
[Download RAW message or body]

On Thursday 02 June 2005 19:18, Michael Buesch wrote:
> I often use dynamic_cast, even if a reinterpret_cast
> would do just fine.

That's really scary. dynamic_cast is for casting up and down class 
hierarchies, which is one use which reinterpret_cast is *not* suitable for 
(but usually will work by coincidence if you happen to only use single 
inheritance). You want static_cast for unsafely casting up/down class 
hierarchies, and you basically *need* to use dynamic_cast if you can't tell 
at compile time how to "get there from here".
-- 
Thanks,
Richard
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic