Basically, there is a C ++ 03 sequence point between each statement. For more information, see the SO C ++ FAQ . For more information, consult the C ++ standard and keep in mind that in C ++ 11 the standard sequence points were replaced by the previously sequenced ones and ordered after the relationship.
To avoid problems, just do not try to be too smart, doing a lot in each expression.
Do not try to complete the compiler task: leave it to the compiler. Your task is to write code that is easy to understand for other people, i.e. clear code . Multiple updates and unnecessary use of operators with side effects are incompatible with this.
Tip: sprinkle const almost everywhere.
This holds back possible state changes that the reader should consider.
Cheers and hth. - alf
source share