array::erase
Remove elements from the array.
Synopsis
array::iterator
erase(
array::const_iterator pos) noexcept; (1)
array::iterator
erase(
array::const_iterator first,
array::const_iterator last) noexcept; (2)
Description
-
(1) the element at
pos
is removed. -
(2) the elements in the range
[first, last)
are removed.
Complexity
-
(1) linear in
std::distance(pos, end())
. -
(2) linear in
std::distance(first, end())
.
Exception Safety
No-throw guarantee.
Return Value
Iterator following the last removed element. If that was the last element of the array, the end()
iterator is returned.
Parameters
Name | Description |
---|---|
|
Iterator to the element to remove |
|
An iterator pointing to the first element to erase, or pointing to the end of the range. |
|
An iterator pointing to one past the last element to erase, or pointing to the end of the range. |