We currently support two ways to erase elements in MapVector: either erase a single element in linear time, which is rather expensive, or erase multiple elements based on a predicate. However, we may want to erase a range of contiguous elements. Here's a motivating example, where the current API is suboptimal:
MapVector.remove_if([&MapVector, N](const auto &Entry) { auto Iter = MapVector.find(Entry.first); return std::distance(Iter, MapVector.end()) > N; });
Instead we could do:
N = MapVector.size() - N; MapVector.erase(MapVector.begin(), MapVector.begin() + N);
This looks not necessary.