From kde-devel Thu Jun 02 20:19:55 2005 From: Richard Smith Date: Thu, 02 Jun 2005 20:19:55 +0000 To: kde-devel Subject: Re: dynamic_cast performance overhead Message-Id: <200506022119.55842.kde () metafoo ! co ! uk> X-MARC-Message: https://marc.info/?l=kde-devel&m=111774473225437 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 <<