I’ve been comparing documentation for the multimap::erase function. After checking out Josuttis and cplusplus.com, it looks as though there are three overloads:
void erase(iterator position);
size_type erase(const key_type& x);
void erase(iterator first, iterator last);
However, the MSDN documentaion appears to suggest three slightly different overloads:
iterator erase(iterator where);
iterator erase(iterator first, iterator last);
bool erase(key_type key)
Why the differences? Am I just being a bit slow and looking at the wrong docs, or has the standard moved on and I’m just looking at outdated documentation?
The correct overloads are (from http://en.cppreference.com/w/cpp/container/multimap/erase):
The cplusplus.com documentation is out of date; the Microsoft documentation is simply incorrect (overloads possibly copied erroneously from
mapdocumentation); it does say later that the third form returns a count of the number of elements removed so clearly cannot returnbool.