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().

Syntax

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

Parameters

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

Return Value

None.


❮ C++ <memory> Library