Why map.erase returns iterator?

Viewed 1456

I've want to erase the elements of the std::map from beginIt to endIt. erase function returns the iterator to the element that follows the last element removed. isn't it endIt ? Why the erase returns iterator ?

auto it = m_map.erase(beginIt, endIt);
2 Answers
Related