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

List:       kde-devel
Subject:    Re: Some thoughts on kdelibs et al.
From:       Guillaume Laurent <glaurent () telegraph-road ! org>
Date:       2001-09-27 12:51:09
[Download RAW message or body]

On Thursday 27 September 2001 14:44, Martijn Klingens wrote:
>
> Though Marc's example was something along the lines of (class*)foo->bar(),
> in which case a dynamic_cast isn't quite an advantage. calling methods on
> pointers that are potentially null if dynamic_cast fails is asking for
> trouble...

Precisely, you can, and should, check if dynamic_cast<> fails. And even if 
you don't, a null ptr dereferencing will give you a cleaner stack trace than 
a cast over the wrong type.

-- 
Guillaume
http://www.telegraph-road.org
 
>> 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