Partager via


allocator_traits::destroy Method

Static method that uses a specified allocator to call the destructor on an object without deallocating its memory.

template<class Uty>
    static void destroy(Alloc& al, Uty *ptr);

Parameters

  • al
    An allocator object.

  • ptr
    A pointer to the location of the object.

Remarks

This method calls al.destroy(ptr), if that expression is well formed; otherwise it evaluates ptr->~Uty().

Requirements

Header: <memory>

Namespace: std

See Also

Reference

allocator::destroy

allocator_traits Class