
On Fri, Mar 11, 2011 at 11:53 AM, Thomas Jarosch < thomas.jarosch@intra2net.com> wrote:
Hello,
here's a small boost::logic::tribool riddle:
-<snip>-------------------------------------
#include <iostream> #include
int main(void) { boost::logic::tribool foo(boost::logic::indeterminate); if (foo != true) { std::cout << "reached1\n"; }
if (foo == boost::logic::indeterminate) { std::cout << "reached2\n"; }
return 0; }
-<snap>-------------------------------------
Try to determine the printed result without looking at the boost::logic::tribool implementation / documentation.
Intuitive?
Ok, I guessed, got it wrong, read the docs, and still don't get it!
Modifying
your example to...
#include <iostream>
#include