451. Associative erase should return an iterator

Section: 26.2.6 [associative.reqmts], 26.4 [associative] Status: Dup Submitter: Bill Plauger Opened: 2004-01-30 Last modified: 2016-02-10

Priority: Not Prioritized

View other active issues in [associative.reqmts].

View all other issues in [associative.reqmts].

View all issues with Dup status.

Duplicate of: 130

Discussion:

map/multimap/set/multiset have:

    void erase(iterator);
    void erase(iterator, iterator);

But there's no good reason why these can't return an iterator, as for vector/deque/list:

    iterator erase(iterator);
    iterator erase(iterator, iterator);

Proposed resolution:

Informally: The table of associative container requirements, and the relevant template classes, should return an iterator designating the first element beyond the erased subrange.

Rationale: