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

`erase` overloads

== Synopses

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

Remove from this list the element at the specified `position`, and return an iterator providing modifiable access to the element immediately following the removed element, or to the position returned by the `end` method if the removed element was the last in the sequence&period; The behavior is undefined unless `position` refers to an element in this list&period;


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

[.small]#xref:bsl/list-054/erase-02.adoc[_» more&period;&period;&period;_]#

Remove from this list the elements starting at the specified `dstBegin` position up to, but not including, the specified `dstEnd` position, and 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;


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

[.small]#xref:bsl/list-054/erase-07.adoc[_» more&period;&period;&period;_]#


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