Quoting Jean-Pierre Bergamin
Hello boost-users
I just ran into quite a bad issue with boost::tribool. The overloaded operators && and || may (and normally do) evaluate the righthand side of logical expressions although not needed/permitted. They i.e. evaluate the rhs expression in a conjunction where the first term is false.
This leads of course to very surprising results. IMHO, the provided operators should be removed or should honor normal semantics. Shall I issue a bug-report? I think the current situation is quite unconvincingly.
Such overloaded operators can't honour "normal" semantics, so that option is out. On the other hand, removing the operators would substantially undermine the whole idea of the tribool class... so I don't think that could be done either. I was surprised though that a "usual" cautionary note about such overloaded operators doesn't appear in the docs though.. perhaps you could add a bug report or patch for that? Pete