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

Erase a range of elements and close the gap by moving&period;

== Synopses

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

Erase a range of elements and close the gap by moving&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
static
void
xref:BloombergLP/bslalg/ArrayPrimitives/erase-0d.adoc[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]#xref:BloombergLP/bslalg/ArrayPrimitives/erase-0d.adoc[_» more&period;&period;&period;_]#

Erase a range of elements and close the gap by moving&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TARGET&lowbar;TYPE&gt;
static
void
xref:BloombergLP/bslalg/ArrayPrimitives/erase-05.adoc[erase](
    TARGET&lowbar;TYPE* first,
    TARGET&lowbar;TYPE* middle,
    TARGET&lowbar;TYPE* last,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator = 0);
----

[.small]#xref:BloombergLP/bslalg/ArrayPrimitives/erase-05.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *first*
| beginning of the range to erase
| *middle*
| end of the range to erase (one past the last)
| *last*
| end of the populated array range
| *allocator*
| allocator used to destroy elements
|===


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