##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::destroy_at

From cppreference.com
< cpp‎ | memory

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()`.

### [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

| This section is incomplete Reason: no example

### [edit] See also

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

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/memory/destroy_at&oldid=86817"
Category:

- Todo no example