
20 May
2008
20 May
'08
1:55 p.m.
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