[#BloombergLP-bslma-AllocatorUtil-deleteObject]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/AllocatorUtil.adoc[AllocatorUtil]::deleteObject
:relfileprefix: ../../../
:mrdocs:

Destroy the object at `p` and deallocate its storage&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;ALLOCATOR,
    class t&lowbar;POINTER&gt;
static
void
deleteObject(
    t&lowbar;ALLOCATOR const& allocator,
    t&lowbar;POINTER p);
----

== Description

Destroy the object at the specified `p` address and return the block of memory at `p` to the specified `allocator`&period; The behavior is undefined unless `p` refers to a fully constructed object allocated from a copy of `allocator` and not yet destroyed or deallocated&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *allocator*
| allocator to which to return the memory
| *p*
| address of the fully constructed object to destroy and deallocate
|===


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