allocator_traits::destroy 方法

使用指定的分配器对该对象的析构函数,而无需释放其内存的静态方法。

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

参数

  • al
    分配器对象。

  • ptr
    对对象的位置的指针。

备注

如果该表达式是限定,此方法调用 al.destroy(ptr);否则它计算 ptr->~Uty()。

要求

标头: <memory>

命名空间: std

请参见

参考

allocator::destroy

allocator_traits 类