std::vector
是的,有一个具有first和last参数的erase函数。
v.erase(v.begin() + 10, v.end());
vec.resize(10); // drops the rest (capacity remains the same)
vec.erase(vec.begin() + 10, vec.begin() + 100);
theVector.erase(theVector.begin() + 10, theVector.begin() + 100);