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

List:       kde-core-devel
Subject:    Re: KPresenter
From:       Reginald Stadlbauer <reggie () troll ! no>
Date:       1999-11-01 22:18:30
[Download RAW message or body]

On Mon, 01 Nov 1999, Kurt Granroth wrote:
>Reginald Stadlbauer wrote:
>> I mean, you can always live without C++ casts, because
>> 
>> dynamic_cast<AClass>( aPtr )->doSomething()
>> 
>> can be replaced by
>> 
>> ( (AClass*)aPtr )->soSomething().
>> 
>> Itīs just that the first (C++) solution is the better one.
>
>Why is it better?  I'll admit that I've never used dynamic_cast before
>as I couldn't see the point.

dynamic_casts do typechecking. So, if it fails, it returns a NULL-pointer.
AFAIK a C cast would just segfault. But as I donīt check the result of each
dynamic_cast the result is the same :-)

And to be honest: Iīm not using dynamic_casts anymore, but I just donīt want 
to go over all the KPresenter and KWord sources and revert the casts :-)

-- 
Reggie

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

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