In the STL almost all containers have an erase function. The question I have is in a vector, the erase function returns an iterator pointing to the next element in the vector. The map container does not do this. Instead it returns a void. Anyone know why there is this inconsistancy?
Share
See http://www.sgi.com/tech/stl/Map.html
The reason for returning an iterator on erase is so that you can iterate over the list erasing elements as you go. If erasing an item doesn’t invalidate existing iterators there is no need to do this.