...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Erase an element.
object::iterator
erase(object::const_iterator
pos) noexcept;
Remove the element pointed to by pos
,
which must be valid and dereferenceable. References and iterators to
the erased element are invalidated. Other iterators and references are
not invalidated.
The end()
iterator (which is valid but
cannot be dereferenced) cannot be used as a value for pos
.
Constant on average, worst case linear in size()
.
No-throw guarantee.
An iterator following the removed element.
Name |
Description |
---|---|
|
An iterator pointing to the element to be removed. |