[#bsl-list-054-erase-07]
= xref:bsl.adoc[bsl]::xref:bsl/list-054.adoc[list]::erase
:relfileprefix: ../../
:mrdocs:

Remove the elements in the half&hyphen;open range `&lsqb;dstBegin &period;&period; dstEnd)&rsqb;`&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;list&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/list-054/iterator.adoc[list&lt;VALUE, ALLOCATOR&gt;::iterator]
erase(
    xref:bsl/list-054/const_iterator.adoc[const&lowbar;iterator] dstBegin,
    xref:bsl/list-054/const_iterator.adoc[const&lowbar;iterator] dstEnd);
----

== Description

Return a non&hyphen;`const` iterator equivalent to `dstEnd`&period; The behavior is undefined unless `dstBegin` is an iterator in the range `&lsqb;begin() &period;&period; end()&rsqb;` and `dstEnd` is an iterator in the range `&lsqb;dstBegin &period;&period; end()&rsqb;` (both endpoints included)&period; Note that `dstBegin` may be equal to `dstEnd`, in which case the list is not modified&period;

== Return Value

iterator to the element following the last erased element

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dstBegin*
| iterator to the first element to remove
| *dstEnd*
| iterator past the last element to remove
|===


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