Namespaces
Variants

std::pmr::polymorphic_allocator<T>:: destroy

From cppreference.net
Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
( until C++20* )
( until C++20* )
( until C++20* )

Garbage collector support (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
template < class U >
void destroy ( U * p ) ;
(自 C++17 起)
(C++20 中弃用)
(C++26 中取消弃用)

销毁由 p 指向的对象,如同通过调用 p - > ~U ( ) 实现。

参数

p - 指向被销毁对象的指针

注释

此函数已通过 LWG issue 3036 被弃用,因为其功能可由 std::allocator_traits::destroy 的默认实现提供,因此是冗余的。

该函数通过 P2875R4 提案已取消弃用状态。

参见

[static]
销毁分配存储中的对象
(函数模板)