R
REH
This curiosity popped into my head on the way to work today. I
wouldn't actually do this, but just wondering. Is the following
defined behavior?
#include <new>
class T { };
int main()
{
T* p = new T();
p->~T();
new(p) T();
delete p;
return 0;
}
wouldn't actually do this, but just wondering. Is the following
defined behavior?
#include <new>
class T { };
int main()
{
T* p = new T();
p->~T();
new(p) T();
delete p;
return 0;
}