Unthinkingly I wrote some code to check that all the values of a struct were set to 0. To accomplish this I used:
bool IsValid() { return !(0 == year ==
== groups from left to right, so if all values are zero then:
==
0 == year // true (0 == year) == month // false, since month is 0 and (0 == year) converts to 1 ((0 == year) == month) == day // true
And so on.
In general, x == y == z is not equivalent to x == y && x == z as you seem to expect.
x == y == z
x == y && x == z