int _tmain(int argc, _TCHAR* argv[])
{
vector<int> a ;//= {12, 23, 34, 45, 56, 67, 78, 89};
a.push_back(10);
a.push_back(40);
a.push_back(10);
a.push_back(10);
a.push_back(10);
for (auto iter = a.begin(); iter != a.end(); ) {
if (*iter > 30) {
iter = a.erase(iter);
}
else
++iter;
}
感谢C海摸鱼的指正