删除部分:
std::map<inti,int> targets; for(auto it = targets.begin(); it!=targets.end();) { if(......) { targets.erase(it++); } else { it++; } }
全部删除:
std::map<inti,int> targets; for(auto it = targets.begin(); it!=targets.end();) { it = targets.erase(it); }