Page 491 of the standard gives three overloaded members 'erase' for
std:map:
void erase(iterator position);
size_type erase(const key_type& x);
void erase(iterator first, iterator last);
A map is an associative container, and page 466 gives requirements for
associative containers. There are three 'erase's, which are the same as
the above but ordered 2,1,3.
According to the text on page 490, a map also meets the requirements of a
container and of a reversible container (subclause 23.1) and "most
operations described in (23.1.2) for unique keys. This means that a map
supports the a_uniq operations but not the a_eq operations."
There is an erase member function that returns an iterator, but it is for
sequence containers (vector, list, deque, page 462, subclause 23.1.1),
not maps.
[^] # Re: Sortie de GCC 3.3.1
Posté par Pascal Terjan . En réponse à la dépêche Sortie de GCC 3.3.1. Évalué à 3.
Page 491 of the standard gives three overloaded members 'erase' for
std:map:
void erase(iterator position);
size_type erase(const key_type& x);
void erase(iterator first, iterator last);
A map is an associative container, and page 466 gives requirements for
associative containers. There are three 'erase's, which are the same as
the above but ordered 2,1,3.
According to the text on page 490, a map also meets the requirements of a
container and of a reversible container (subclause 23.1) and "most
operations described in (23.1.2) for unique keys. This means that a map
supports the a_uniq operations but not the a_eq operations."
There is an erase member function that returns an iterator, but it is for
sequence containers (vector, list, deque, page 462, subclause 23.1.1),
not maps.