Your question does not make sense.
Why not skip side effects (since the destructor is not called), and the program starts normally without side effects?
They are omitted because they would be called by the destructor and not called.
My reading:
and any program that depends on the side effects created by the destructor has undefined behavior.
just, I view it in the light of RAII. Example:
#include "Object.hpp" struct Manager: private boost::noncopyable { union Raw { char _[sizeof(Object)]; Object o; }; static Raw raw; Manager() { new (raw.o) Object(); } ~Manager() { raw.o.~Object(); } };
Now, if I select Manager , forgets to destroy it and allocates a new one, I am in a pinch because I am overwriting the repository of the first Object created with the second, even if it is still "alive". This behavior is undefined.
Matthieu M. Apr 02 2018-12-12T00: 00Z
source share