[#BloombergLP-bslalg-DequePrimitives-0c-erase]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/DequePrimitives-0c.adoc[DequePrimitives&lt;VALUE&lowbar;TYPE, 1&gt;]::erase
:relfileprefix: ../../../
:mrdocs:

Erase a range of elements from a deque and close the gap&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
static
xref:BloombergLP/bslalg/DequePrimitives-0c/Iterator.adoc[DequePrimitives&lt;VALUE&lowbar;TYPE, 1&gt;::Iterator]
erase(
    xref:BloombergLP/bslalg/DequePrimitives-0c/Iterator.adoc[Iterator]* toBegin,
    xref:BloombergLP/bslalg/DequePrimitives-0c/Iterator.adoc[Iterator]* toEnd,
    xref:BloombergLP/bslalg/DequePrimitives-0c/Iterator.adoc[Iterator] fromBegin,
    xref:BloombergLP/bslalg/DequePrimitives-0c/Iterator.adoc[Iterator] first,
    xref:BloombergLP/bslalg/DequePrimitives-0c/Iterator.adoc[Iterator] last,
    xref:BloombergLP/bslalg/DequePrimitives-0c/Iterator.adoc[Iterator] fromEnd,
    ALLOCATOR allocator);
----

== Return Value

iterator to the element immediately following the removed elements

== Parameters

[cols="1,4"]
|===
| Name| Description
| *toBegin*
| loads the new beginning iterator of the deque
| *toEnd*
| loads the new end iterator of the deque
| *fromBegin*
| current beginning of the deque
| *first*
| beginning of the range to erase
| *last*
| end of the range to erase (one past the last)
| *fromEnd*
| current end of the deque
| *allocator*
| allocator used to destroy elements
|===


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