学习

来源:互联网 发布:linux下查看path 编辑:程序博客网 时间:2024/06/07 00:11
// 目的:演示学习一下标准库(出现页码没有特别指明,一律指 《c++标准程序库》一书//  // 知识注意点:// 如果高效率是你的最高目标,你应该优先选用成员函数。 p117//#include "stdafx.h"#include <iostream>#include <list>#include <iostream>#include <algorithm>using namespace std;int _tmain(int argc, _TCHAR* argv[]){list<int> coll;// insert elementfor (int i = 0; i < 6; ++i){coll.push_front(i);coll.push_back(i);}#if 1coll.remove(4); // good Perfomance#elsecoll.erase(remove(coll.begin(), coll.end(), 3), coll.end()); // poor Perfomance#endifreturn 0;}


0 0