What exactly is the “as-if” rule?

What is the “as-if” rule? The “as-if” rule basically defines what transformations an implementation is allowed to perform on a legal C++ program. In short, all transformations that do not affect a program’s “observable behavior” (see below for a precise definition) are allowed. The goal is to give implementations freedom to perform optimizations as long … Read more