For { A=a; B=b; }, will “A=a” be strictly executed before “B=b”?

Both standards allow for these instructions to be performed out of order, so long as that does not change observable behaviour. This is known as the as-if rule:

  • What exactly is the “as-if” rule?
  • http://en.cppreference.com/w/cpp/language/as_if

Note that as is pointed out in the comments, what is meant by “observable behaviour” is the observable behaviour of a program with defined behaviour. If your program has undefined behaviour, then the compiler is excused from reasoning about that.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)