Boost logo

Boost :

From: klaus triendl (klaus_at_[hidden])
Date: 2008-05-20 09:34:10


Hi,

I've just used a tribool and a null pointer together in an if-expression:

if (a_tribool || *a_bool_pointer)
   ...

leading to an access violation, because operator || is overloaded for
tribool and dereferencing the pointer occurs before calling operator ||
instead of short-circuiting the expression.

Is this by design and do I have to access the tribool's 'value' member
directly?

Thanks,
Klaus Triendl


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk