[PyKDE] SIP-4.0rc1 minor build /install issues

Gerard Vermeulen gvermeul at grenoble.cnrs.fr
Fri Dec 12 09:23:01 GMT 2003


On Thu, 11 Dec 2003 22:26:39 +0000
Phil Thompson <phil at riverbankcomputing.co.uk> wrote:

[ .. ]

> Is there a "standard" way of handling the case where the C++ compiler doesn't 
> support the bool type?
> 
Page 3 and 4 of Scott Meyers' "More Effective C++" indicates two ways:

1. enum bool { false, true };

disadvantage that it breaks when compiling with a compiler that truly supports
bool. For instance:

void f(int);
void f(bool);

int x, y;

f(x<y); // it calls f(int) when f(bool) is expected

2.
typedef int bool;
const bool false = 0;
const bool true = 1;

disadvantage that you can't differentiate between f(int) and f(bool) when
overloading.


So, option 2 looks safer to me (less free, too).
Anyhow, I'd like to see such workarounds within
#define SIP_HAS_NO_BOOL
#endif
construct.

Gerard




More information about the PyQt mailing list