Talk:cpp/language/eval order

The section/page states that the "order of evaluation of the operands of almost all C++ operators (including the order of evaluation of function arguments in a function-call expression and the order of evaluation of the subexpressions within any expression) is unspecified."

(Since C++11)Does unspecified only mean unsequenced or can it also include indeterminately sequenced? My guess is that it means unsequenced, but it would be nice to know for sure.


 * unspecified only means what it says in the next sentence ("The compiler can evaluate operands in any order, and may choose another order when the same expression is evaluated again."). Sequencing is described on the rest of this page. There are cases where the arguments are unsequenced, when they are indeterminately-sequenced, and when they are sequenced. --Cubbi (talk) 10:58, 28 November 2018 (PST)

Also, what is meant by "(but not the side effects)" in point 8) "The side effect (modification of the left argument) of the built-in assignment operator and of all built-in compound assignment operators is sequenced after the value computation (but not the side effects) of both left and right arguments, and is sequenced before the value computation of the assignment expression (that is, before returning the reference to the modified object)"? I.e., are the side effects unsequenced, inderminately sequenced or sequenced after the modification after the left argument (perhaps even sequenced after the returning of the reference?

FrotzMe (talk) 01:50, 28 November 2018 (PST)


 * no sequencing means what it says: no sequencing. That is, unsequenced (unless there is another clause that applies a sequencing guarantee). For example, a = a++ is undefined because the two side effects are unsequenced, unless the operators are overloaded, in which case the rule about function calls makes them indeterminately-sequenced. --Cubbi (talk) 10:58, 28 November 2018 (PST)