|
|
For the built-in logical OR operator, the result is true if either the first or the second operand (or both) is true. If the first operand is true, the second operand is not evaluated. http://en.cppreference.com/w/cpp/language/operator_logical |
&&
is higher than||
. Thus it should be evaluated first and y should be incremented. Isn't that so?
&&
is higher than ||
++x || ++y && ++z
is parsed as ++x || ( ++y && ++z )
( ++y && ++z )
only if bool(++x)
is false.
++x || ++y && ++z |
++x || (++y && ++z) |