Talk:Sequence point
From Wikipedia, the free encyclopedia
Regarding this change: http://en.wikipedia.org/w/index.php?title=Sequence_point&diff=next&oldid=15491632 I realise that when operators are overloaded there are necessarily additional sequence points due to the extra function calls, but this applies to many of the other cases as well - in certain ways, C++ overloaded operators are a whole different ball game.
By definition when operators are overloaded, the ++ has to store its result first and make a copy of the old value, but for built-in types is the compiler not free to use any valid instruction order between sequence points as had been described? I admit I expanded on that section slightly when merging without consulting other sources though.
Of course, half of the point is that for any sensible expression, it doesn't matter what order these different values are updated... but it could make a difference if (for example) p happens to point to the location where its own value (or that of q) is stored, etc.