标签:map map遍历 else tor cto class span nbsp iterator
map遍历删除
1 map<int, vector<int>>::iterator it = g_map.begin(); 2 for (; it != g_map.end(); /*it++*/) 3 { 4 g_map.erase(it++); 5 }
vector遍历删除
1 vector<int>::iterator iter = vec.begin(); 2 while (iter != vec.end()) 3 { 4 if(*iter == 1) 5 { 6 iter = vec.earse(iter); 7 } 8 else 9 { 10 ++iter; 11 } 12 }
标签:map map遍历 else tor cto class span nbsp iterator
原文地址:http://www.cnblogs.com/jgliuhui1988/p/6207901.html