Facebook Page Twitter Page LinkedIn Page
× C++ Standard Library C++ STL Library

The C++ <memory> allocator_traits::destroy destroys the element object pointed by p without deallocating its storage.

If possible, it does so by calling alloc.destroy(p). If not possible (e.g. Alloc does not have the member function destroy()), then it calls the destructor of *p directly, as p->~T().


template <class T>
  static void destroy (allocator_type& alloc, T* p);


alloc Allocator to use for destruction.
p Pointer to the object being destroyed.

Return Value


❮ C++ <memory> Library