[#bsl-list-054-erase-07] = xref:bsl.adoc[bsl]::xref:bsl/list-054.adoc[list]::erase :relfileprefix: ../../ :mrdocs: Remove the elements in the half‐open range `[dstBegin .. dstEnd)]`. == Synopsis Declared in `<bslstl_list.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/list-054/iterator.adoc[list<VALUE, ALLOCATOR>::iterator] erase( xref:bsl/list-054/const_iterator.adoc[const_iterator] dstBegin, xref:bsl/list-054/const_iterator.adoc[const_iterator] dstEnd); ---- == Description Return a non‐`const` iterator equivalent to `dstEnd`. The behavior is undefined unless `dstBegin` is an iterator in the range `[begin() .. end()]` and `dstEnd` is an iterator in the range `[dstBegin .. end()]` (both endpoints included). Note that `dstBegin` may be equal to `dstEnd`, in which case the list is not modified. == 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]#