当需要erase list里的元素时
代码可写为以下形式,可避免list iterator incrementable
std::list<int> T;
std::list<int>::iterator rpos;
for(rpos=T.begin();rpos!=T.end();)
rpos = T.erase(rpos);
转载于:https://www.cnblogs.com/cloudseawang/archive/2007/08/02/840419.html
转载于:https://www.cnblogs.com/cloudseawang/archive/2007/08/02/840419.html