Objects constructed on a pre-allocated buffer by using placement new must be destroyed explicitly.
#include #include using namespace std;class C{public: C() { cout<< "constructed" <C::~C(); //explicit destructor invocation is required delete [] p; return 0;}
Without an explicit destructor invocation, the object would never be destroyed, yet the memory on which it was created would be released by the delete[] statement.