
11 Mar
2011
11 Mar
'11
4:53 a.m.
Hello, here's a small boost::logic::tribool riddle: -<snip>------------------------------------- #include <iostream> #include <boost/logic/tribool.hpp> 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? A coworker just shot himself in the foot... Best regards, Thomas Jarosch