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

List:       kde-devel
Subject:    Re: dynamic_cast performance overhead
From:       Sunil <funtoos () yahoo ! com>
Date:       2005-06-02 21:29:06
Message-ID: 20050602212906.70778.qmail () web31708 ! mail ! mud ! yahoo ! com
[Download RAW message or body]

does compiler optimize uses such as this:
----------
./kate/part/kateschema.cpp:

void KateStyleListView::showPopupMenu(
KateStyleListItem *i, const QPoint &globalPos, bool
showtitle )
                                                      
           ^^^^^^^^^^^^^
{
  if ( !dynamic_cast<KateStyleListItem*>(i) ) return;
                                ^^^^^^^^^^^^^
----------

Thanks,
-Sunil


--- Dirk Mueller <mueller@kde.org> wrote:

> On Thursday 02 June 2005 22:26, Michael Buesch
> wrote:
> 
> > > Maybe a template function or something similiar
> would be better.
> > Such as this. This is tested and prints a friendly
> debug
> > message in DEBUG mode. Otherwise is optimized by
> the
> > compiler to nothing (normal reinterpret_cast).
> 
> Which is WRONG. I wonder how you tested that.
> reinterpret_cast<> doesn't do 
> the base pointer adjustment necessary for multiple
> inheritance. Don't ever 
> use such code. And even more important, don't ever
> make other people use such 
> ugly code. 
> 
> 
> -- 
> Dirk//\
>  
> >> Visit
> http://mail.kde.org/mailman/listinfo/kde-devel#unsub
> to unsubscribe <<
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
 
>> 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