您的位置:首页 > 其它

STL的东西好多好杂呀~

2016-07-14 09:50 281 查看
1.高效地使用STL:http://www.cnblogs.com/me115/p/4596543.html

2.一些string的算法:http://blog.csdn.net/hkx1n/article/details/6169130

3.STL中erase()小心使用 : http://blog.csdn.net/yangruibao/article/details/9040045 ; http://www.cnblogs.com/kex1n/archive/2011/12/06/2278505.html  (for map)

4.C++STL中map.erase(it++)用法原理解析 : http://m.blog.csdn.net/article/details?id=50950843
高能预警__下面下面啦~
set<int> se;
set<int> :: iterator it;

int main()
{
for (int i=0; i<10; i++)
{
se.insert (i);
}
it = se.find(7);
if (it == se.end())
{
se.erase (it); //it这个迭代器只是失效了,并没有丢哦~
}
else
{
cout << "ohehe~~ " << endl;
}
for (it = se.begin(); it!=se.end(); it++)
{
cout << *it << endl;
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: