As-if rule in C++

Previous: Compiler optimizations in C++

The as-if rule says that a compiler is allowed to make modifications to a program in attempt to optimize as long as the effects do not affect the observable behavior.