The faq states that an explicit call to the destructor must be made,
however, I don't see why a simple 'delete f' wouldn't work in this case.
At least my test code works correctly on FC5 with g++ 4.1.1. 'delete
f' correctly invokes 'f->~Fred()' and 'operator delete'.
void someCode()
{
char memory[sizeof(Fred)];
void* p = memory;
Fred* f = new(p) Fred();
...
f->~Fred(); // Explicitly call the destructor for the placed object
}
any comments?
Fei