order of evaluation of function parameters

From the C++ standard:

The order of evaluation of arguments is unspecified. All side effects of argument expression evaluations take effect before the function is entered. The order of evaluation of the postfix expression and the argument expression list is unspecified.

However, your example would only have undefined behavior if the arguments were x>>=2 and x<<=2, such that x were being modified.

Leave a Comment