C++中P.J. Plauger STL和SGI STL中map的区别

来源:互联网 发布:能写作的软件 编辑:程序博客网 时间:2024/05/16 19:20

P.J. Plauger STL和SGI STL中map的erase方法实现是有区别的,其中Windows下常用的是P.J. Plauger STLP,Linux下是SGI STL,SGI STL实现了标准的STL规范。

.J. Plauger STL:

[cpp] view plaincopy
  1. for(ITER iter = mapTest.begin(); iter != mapTest.end();)   
  2. {   
  3.     iter = mapTest.erase(iter);   
  4. }   

SGI STL:

[cpp] view plaincopy
  1. for(ITER iter = mapTest.begin(); iter != mapTest.end();)   
  2. {   
  3.     mapTest.erase(iter++);   
  4. }   


转自:http://blog.csdn.net/donhao/article/details/6636098