3 Dec
2011
3 Dec
'11
7:02 p.m.
Igor R
Ok, now I want to make find() and erase() methods. In std::map, they return an iterator. Should I wrap the methods find() and erase(), to pass a const K& key, and return a container1:: const_iterator. is it right?
std::map::find and std::map::erase have several overloads: http://www.cplusplus.com/reference/stl/map/find/ http://www.cplusplus.com/reference/stl/map/erase/ And none of erase() overloads returns iterator.
erase *does* return an iterator. The docs you're using are non-compliant, take a look for instance at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf HTH, Joaquín M López Muñoz Telefónica Digital