Effective STL 为包含指针的关联容器指定比较类型
来源:互联网 发布:windows选择哪个 编辑:程序博客网 时间:2024/05/30 23:39
// 为包含指针的关联容器指定比较类型.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <set>#include <string> #include <iostream>using namespace std;struct StringPtrLess:public binary_function<const string*, const string*, bool>{bool operator()(const string *ps1, const string *ps2) const{return *ps1 < *ps2;}};typedef set<string*, StringPtrLess> StringPtrSet;StringPtrSet ssp;int main(){ssp.insert(new string("apple"));ssp.insert(new string("toy"));ssp.insert(new string("cat"));for (StringPtrSet::const_iterator i = ssp.begin();i != ssp.end();++i){cout<<(**i)<<endl;}getchar();return 0;}
0 0
- Effective STL 为包含指针的关联容器指定比较类型
- effective stl: 第20条,为包含指针的关联容器指定比较类型
- Effective STL - 为指针的关联容器指定比较函数
- 条款20:为指针的关联容器指定比较类型——effective STL
- 为包含指针的关联容器指定比较类型
- 为包含指针的关联容器指定比较类型
- 为包含指针的关联容器指定比较类型
- 为指针的关联容器指定比较类型
- 为指针的关联容器指定比较类型
- 使用STL的经验总结_指定关联容器的比较类型_12
- Effective STL --关联容器
- Effective STL 条款21: 关联容器的strict weak order(让比较函数对相等的值返回false)
- Effective STL 条款21: 关联容器的strict weak order(让比较函数对相等的值返回false)
- Effective STL 条款21: 关联容器的strict weak order(让比较函数对相等的值返回false) .
- Effective STL 条款21: 关联容器的strict weak order(让比较函数对相等的值返回false)
- Effective STL 条款21: 关联容器的strict weak order(让比较函数对相等的值返回false)
- effective stl 第33条:对包含指针的容器使用remove这一类算法时要特别小心
- Effective STL 第7条:如果容器中包含了通过new操作创建的指针,切记在容器对象析构前将指针delete掉
- java.lang.NoClassDefFoundError: javax/servlet/ServletInputStream fileupload.FileUpload.doPost(FileU
- Beyond Compare使用教程
- MyEclipse2014与MySQL中文乱码问题
- hdu 4952Number Transformation
- python 装饰器 与 面向切面编程(转)
- Effective STL 为包含指针的关联容器指定比较类型
- UIWindow
- (9)javaEE---equest与response
- servlet工作原理分析
- 自己设计并使用断言
- GIT基本概念和用法总结
- POJ 2112Optimal Milking 最大流
- Spring之Chaper 4, The IoC container-4.2 Container view(容器总述)
- javaweb 验证码制作