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

List:       kde-devel
Subject:    Re: Use true/false or TRUE/FALSE in KDE C++ programs?
From:       Nicos Gollan <gtdev () spearhead ! de>
Date:       2005-05-29 13:43:04
Message-ID: 200505291543.15945.gtdev () spearhead ! de
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Sunday May 29 2005 13:27, Richard Dale wrote:
> I was wondering if there was a more correct boolean literal to use. I
> noticed that the Qt docs have upper case booleans, but when I searched the
> sources in kdelibs there were more instances of lower case ones.

The thing with Qt is that it doesn't assume any standard-C++ features like 
namespaces, a working STL implementation or the standard boolean type "bool" 
to be present, so it defines its own of everything (just have a look at the 
comments in the Qt sources for the declaration of the class "Qt" in 
qnamespace.h to get the idea of not using namespaces). By using the uppercase 
variety, it avoids ambiguities on systems which do have a "bool" type with 
true/false values.

The correct literals by the C++ standard are the lowercase true/false values, 
but that might cause problems on systems with Really Old(TM) compilers unless 
you handle that somehow, e.g. with autotools.

-- 
Got Backup?

Jabber: Shadowdancer at jabber.fsinf.de

[Attachment #5 (application/pgp-signature)]

>> 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