| Home | Libraries | People | FAQ | More

###### object::erase (1 of 2 overloads)

Erase an element.

<h7> Synopsis </h7>

    iterator
    erase(
        const_iterator pos);

<h7> Description </h7>

Remove the element pointed to by `pos`, which must be valid and dereferenceable. Thus the `end()` iterator (which is valid but cannot be dereferenced) cannot be used as a value for `pos`. References and iterators to the erased element are invalidated. Other iterators and references are not invalidated.

<h7> Complexity </h7>

Constant on average, worst case linear in `size()`.

<h7> Exception Safety </h7>

No-throw guarantee.

<h7> Return Value </h7>

An iterator following the last removed element.

<h7> Parameters </h7>

Name | Description
--- | ---
`pos` | An iterator pointing to the element to be removed.