Boost logo

Boost :

From: Alex MDC (alex.mdc_at_[hidden])
Date: 2008-05-20 09:55:38


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

I wouldn't say it's "by design" - rather it's an unfortunate limitation of
C++ that overloaded boolean operators cannot emulate the short-circuiting
behaviour as with builtin types.

You could try something like:
if ((a_tribool == true) || *a_bool_pointer)
to convert the left-hand side back to a native bool and get the
short-circuiting.

Regards,
Alex


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