Namespaces
Variants
Views
Actions

std::destroy_at

From cppreference.com
< cpp‎ | memory
 
 
 
Dynamic memory management
Uninitialized storage
destroy_at
(C++17)
(deprecated since c++17)
(deprecated since c++17)
(deprecated since c++17)
Garbage collection support
Miscellaneous
(C++11)
(C++11)
C Library
Low level memory management
 
Defined in header <memory>
template< class T >
void destroy_at( T* p );
(since C++17)

Calls the destructor of the object pointed to by p, as if by p->~T().

Contents

[edit] Parameters

p - a pointer to the object to be destroyed

[edit] Return value

(none)

[edit] Possible implementation

template<class T>
void destroy_at(T* p) 
{ 
    p->~T(); 
}

[edit] Example

[edit] See also

(C++17)
destroys a range of objects
(function template) [edit]
(C++17)
destroys a number of objects in a range
(function template) [edit]