...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 preserving order.
object::iterator
stable_erase(object::const_iterator
pos) noexcept;
Remove the element pointed to by pos
,
which must be valid and dereferenceable. References and iterators from
pos
to end()
,
both included, are invalidated. Other iterators and references are not
invalidated. The relative order of remaining elements is preserved.
The end()
iterator (which is valid but
cannot be dereferenced) cannot be used as a value for pos
.
Linear in size()
.
No-throw guarantee.
An iterator following the removed element.
Name |
Description |
---|---|
|
An iterator pointing to the element to be removed. |