allocator::deallocate
void deallocate(pointer p, size_type n);
The member function frees storage for the array of n objects of type T beginning at p, by calling operator delete(p). The pointer p must have been earlier returned by a call to allocate for an allocator object that compares equal to *this, allocating an array object of the same size and type.
因为STL不知道你插入的元素是从stack还是heap上分配的,只能由你自已决定
比如:class A {} ;
vector<A*> vec(10) ;
A a1 ;
A *a2 = new A ;
vec.push_back(&a1) ;
vec.push_back(a2) ;
delete a2 ;