I would very much appreciate it if someone could give a clarification on the sequencing of side effects for assignment statements in C++11. E.g., point me to the relevant standard text that deals with it.
The page on evaluation order on cpprefence.com states the following regarding assignments:
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)
What is meant by "(but not the side effects)? Are the side effects unsequenced, inderminately sequenced or sequenced after the modification of the left argument (or perhaps even sequenced after the returning of the reference?
As an example when do the post-increment operations take place in: while (*tgt++= *src++);
It seems clear from evaluation order that the value calculations are performed first, so *tgt
and *src
are calculated first. But is it known when post-increment side effects occur?
Edit #1:
Undefined behavior and sequence points does to my best understanding not answer my question. In fact it was the start of my descent into the "rabbit hole" that in the end led me to cppreference.com
. What I specifically want to know is the definition of sequencing of side effects for the assignment operator in C++11. The question answered in Undefined behavior and sequence points is the relation between sequencing and the concepts of undefined
, unspecied behaviour
and impementation specific behaviour
. Which, by the way, it answers very well.
End of Edit #1
Best regards