[#BloombergLP-bslalg-ArrayPrimitives-erase-0d]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/ArrayPrimitives.adoc[ArrayPrimitives]::erase
:relfileprefix: ../../../
:mrdocs:

TBD&colon; improve comment Destroy the elements of type given by the `allocator&lowbar;traits` class template for (template parameter) `ALLOCATOR` starting at the specified `first` `first` pointer and ending immediately before the specified `middle` pointer, and move the elements in the array starting at `middle` and ending at the specified `last` pointer down to the `first` pointer&period; If an assignment throws an exception during this process, all of the elements in the range `&lsqb; first, last )&rsqb;` will have unspecified but valid values, and no elements are destroyed&period; The behavior is undefined unless `first &lt;&equals; middle &lt;&equals; last`&period;

== Synopsis

Declared in `&lt;bslalg&lowbar;arrayprimitives&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
static
void
erase(
    bsl::allocator&lowbar;traits&lt;ALLOCATOR&gt;::pointer first,
    bsl::allocator&lowbar;traits&lt;ALLOCATOR&gt;::pointer middle,
    bsl::allocator&lowbar;traits&lt;ALLOCATOR&gt;::pointer last,
    ALLOCATOR allocator);
----


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