News for hackers. Stuff that matters.
Re:Why 1 && 2 == 2 by pbsd on Thursday July 18, 2013 @10:07PM (#6067903)
In C++, << has higher precedence than &&, so in effect what is being done is

    (cout << 1) && 2;
...which is not an error, since the result of operator<< is an std::ostream, which is convertible to bool. Therefore operator&&(bool, bool) is invoked but the result is, of course, discarded.

Disambiguating the expression with parentheses should output 1 in every case.

Re:Why 1 && 2 == 2 by chewxy on Thursday July 18, 2013 @10:50PM (#6068033)
I wrote the article (didn't plan on HN traffic, thanks Boyter). I've fixed it with your comment.

Thanks