public member function
<memory>

std::allocator::destroy

void destroy (pointer p);
template <class U>  void destroy (U* p);
Destroy an object
Destroys in-place the object pointed by p.

Notice that this does not deallocate the storage for the element (see member deallocate to release storage space).

The function usesvalue_type's destructor (value_typeis a member type, alias of the allocator's template parameter), as if the following code was used
p->~value_type();
The function uses U's destructor, as if the following code was used
p->~U();

参数

p
Pointer to the object to be destroyed.

返回值



另见