public static member function
<memory>

std::allocator_traits::destroy

template <class T>  static void destroy (allocator_type& alloc, T* p);
Destroy object
Destroys the element object pointed by p without deallocating its storage.

In the non-specialized definition of allocator_traits, this member function callsalloc.destroy(p)if such a call is well formed. Otherwise, it invokesp->~T(). A specialization for a specific allocator type may provide a different definition.

参数

alloc
Allocator object
allocator_typeis an alias of allocator_traits's template parameter.
p
Pointer to an element.

返回值



另见