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 ==
The return of the == operator is 1 if the operands are equal, so regardless wether this is read from left to right or right to left, this will not do what you expect.
so this could only work in an analogous test if you would be interested if all values are 1.
And to have a shorter expression since you seem interested in that just do year || day || ...