erase member functions of std::map class template do not conform to standard: std::map<...>::erase(iterator) and std::map<...>::erase(iterator, iterator) both return void when they should return iterator (23.3.1): bits/stl_map.h:444 void erase(iterator __position) { _M_t.erase(__position); } bits/stl_map.h:474 void erase(iterator __first, iterator __last) { _M_t.erase(__first, __last); } The standard requires signature of these functions to be: iterator erase(iterator); iterator erase(iterator, iterator);
I have the standard in front of me, both the printed version and the electronic version, and certainly you are wrong, both overloads return void.
According to the working drafts http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2009.pdf and http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1905.pdf I am right. But since they are drafts I may still be wrong.
Working drafts are working drafts, and therefore are about the *next* standard, not the current one, C++03. When the new standard will be out, and we'll provide a conforming implementation, breaking the ABI, we'll provide different overloads of erase and *a lot* of new / incompatible stuff.