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

List:       kde-core-devel
Subject:    Re: kdelibs/kparts
From:       Lars Knoll <knoll () kde ! org>
Date:       2001-09-24 10:00:18
[Download RAW message or body]

On Sunday 23 September 2001 22:47, Rik Hemsley wrote:
> #if Michael Matz
>  I wonder why people are reinventing wheels instead using RTTI, which is
>
> > the compiler supported mean for such things.  OK, I didn't yet read the
> > code generated and may be, it can be used for something, for which RTTI
> > is inappropriate but up to now I don't know for what it is good.
>
> Perhaps Qt does it because rtti doesn't work on some compilers it
> supports ?

Yes. thats exactly the reason. We can't use it in Qt because there are still 
some compilers out there that do not support it. IMO KDE should use rtti for 
it's purposes. It's a lot faster than an inherits() call, and works with the 
compilers KDE supports.

Cheers,
Lars

> BTW, you are right that strcmp is a lot slower than dynamic_cast.
> I just tested and for class names of 6 letters, strcmp took 10s
> to do what dynamic_cast did in 0.7s (looping 100,000,000 times.)
>
> Rik

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

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