Pete said:
In that case, it's unspecified. The two increment calls aren't ordered.
...
Yes, but the original question was not about the "behavior", but about
the "result". While the OP didn't specify what exactly he meant by
"result" (probably the result of 'x == 4' expression), for many natural
interpretations of the term it is possible to come up with operator
definitions, which will produce a well defined "result" even though the
overall "behavior" is not specified.
A more important question, though, is "who cares?"
Apparently the OP and his workmates do. Moreover, the only people who
shouldn't care are the people who are already past that stage in their
learning process. That's definitely not everybody.
Is it really worhwhile
> spending time talking about the hypothetical meaning of an expression
> that should never appear in real-world code?
True, but I don't see the connection. I have no reason to believe the
expressions in the subject line were taken from the real-world code, or
that anyone actually intended to use them in the real-world code.