Category : as-if

What is the reason the C++ standard allows(requires) compilers to optimize away calls to copy constructor(in certain cases), even though it might contain observable side effects? If I’m not mistaken, the "as if" rule already allows compilers to optimize unnecessary code away, as long as the resulting program emulates the observable behavior of the abstract ..

Read more