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 uses value_type's destructor (value_type is 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();

Parameters

p
Pointer to the object to be destroyed.

Return value

none

See also