1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #include <list> int main() { std::list<int> l; l.push_back(1); l.push_back(2); l.push_back(3); std::list<int>::iterator it=l.begin(); for (; it!=l.end(); ) { printf("%d ", *it); if (*it == 1) { // if (*it == 2) { // if (*it == 3) { // if (true) { printf("erased.\n"); it = l.erase(it); } else { printf("\n"); it++; } } return 0; } |
^_^
2009年8月4日星期二
VS2005 “list iterator not incrementable”的解决方法
本站文章除注明外,均为本站原创
转载请注明文章转载自: 大笨熊乐园 [ https://blog.foolbear.com/ ]
文章标题: VS2005 “list iterator not incrementable”的解决方法
文章地址: https://blog.foolbear.com/2009/08/vs2005-list-iterator-not-incrementable.html
转载请注明文章转载自: 大笨熊乐园 [ https://blog.foolbear.com/ ]
文章标题: VS2005 “list iterator not incrementable”的解决方法
文章地址: https://blog.foolbear.com/2009/08/vs2005-list-iterator-not-incrementable.html
相关文章:
- Android 5.1 Google Now 开启方法 - 2015-04-22
- Nexus 4 官方 Android 5.1 OTA 释出 - 2015-04-15
- 洋洋学步 - 2025-03-31
- 周末闲逛 - 2025-03-29
- Three - 2025-03-02
订阅:
博文评论
(
Atom
)
没有评论 :
发表评论