Order of evaluation for most of the binary operators is left undefined to give the compiler opportunities for optimization
belongs to book: C++ Primer|Stanley B.Lippman, Josee Lajoie, Barbara E.Moo|5th Edition| Chapter number:4| Question number:4.3
All Answers
total answers (1)
I think that is an acceptable trade-off. When an expression refers to and change the same object, we can always seperate that expression into several expressions to avoid the situation except where:
- The operator involved is one of _and `&&`, or `||`, conditional `?:`, comma `,`_ operator,
- The subexpression that change the operand is itself the operand of another subexpression.