[#bsl-allocator_traits-0ae-destroy]
= xref:bsl.adoc[bsl]::xref:bsl/allocator_traits-0ae.adoc[allocator&lowbar;traits&lt;std::allocator&lt;ALLOCATOR&lowbar;TYPE&gt;&gt;]::destroy
:relfileprefix: ../../
:mrdocs:

Destroy an object of type _&lowbar;Tp_

== Synopsis

Declared in `&lt;bslma&lowbar;allocatortraits&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename &lowbar;Tp&gt;
constexpr
static
void
destroy(
    &lowbar;Alloc& &lowbar;&lowbar;a,
    &lowbar;Tp* &lowbar;&lowbar;p) noexcept(&lowbar;S&lowbar;nothrow&lowbar;destroy&lt;&lowbar;Tp&gt;());
----

== Description

Calls `&lowbar;&lowbar;a&period;destroy(&lowbar;&lowbar;p)` if that expression is well&hyphen;formed, otherwise calls `&lowbar;&lowbar;p&hyphen;&gt;&#126;&lowbar;Tp()`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *&lowbar;&lowbar;a*
| An allocator&period;
| *&lowbar;&lowbar;p*
| Pointer to the object to destroy
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
