Why there is no placement delete expression in C++?
问题 Why C++ hasn't placement delete that directly corresponds to the placement new, i.e. calls the destructor and calls appropriate placement delete operator? For example: MyType *p = new(arena) MyType; ... //current technique p->~MyType(); operator delete(p, arena); //proposed technique delete(arena) p; 回答1: operator delete is unique in being a non-member or static member function that is dynamically dispatched. A type with a virtual destructor performs the call to its own delete from the most