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

List:       kde-devel
Subject:    Re: Some thoughts on kdelibs et al.
From:       Carsten Pfeiffer <carpdjih () cetus ! zrz ! tu-berlin ! de>
Date:       2001-09-27 22:26:24
[Download RAW message or body]

On Mittwoch, 26. September 2001 18:25 Marc Mutz wrote:

> Apropos casts: Any style guide suggesting to use the advanced xxx_casts
> for all clas-related stuff? Ie:
>
> QLineEdit *le  dynamic_cast<QLineEdit*>(combobox->children()->first());
> Q_ASSERT( le );
> le->selectAll();

Generally, yes, C++ style casts are preferred. In this example, it would have 
been much safer to iterate over the list of children instead of hardcoding 
the first child (and checking with dynamic_cast).

> And... Using Q_ASSERT everywhere instead of assert and defining
> -DQT_FATAL_ASSERT in the Makefiles?

What's wrong with assert()?

Cheers
Carsten Pfeiffer
 
>> 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