Well, I know this sounds pure evil. I was reading this SO post and stumbled upon the technique of reconstructing a stack object. The basic idea is:
{
T obj(...); // dtor will be called at end of scope
obj.~T(); // YOLO
new (&obj) T(...);
// obj goes out of scope. The compiler inserts `obj.~T();` here.
}
...so that we can reuse the same chunk of memory for as many times as we like. Is this code legal by the standard? Is craziness like this undefined behavior?