std::set 和 std::pair 搭配使用
2011-08-01 19:18
246 查看
struct CompareKey : public std::unary_function<std::pair<int, int>, bool>
{
bool operator ()(const std::pair<int, int>& p1,
const std::pair<int, int>& p2) const
{
return p1.first < p2.first;
}
};
std::set<std::pair<int, long>, CompareKey > somevar;
{
bool operator ()(const std::pair<int, int>& p1,
const std::pair<int, int>& p2) const
{
return p1.first < p2.first;
}
};
std::set<std::pair<int, long>, CompareKey > somevar;
相关文章推荐
- set/multiset,map/multimap的使用与比较+pair介绍
- std::pair的使用
- 关于VS2012使用make_pair编译提示“error C2664: “std::make_pair”: 不能将参数 1 从“int”转换为“int &&””
- C++中std::pair的使用
- 高效的使用stl::map和std::set
- STL之关联容器(pair、map、set的使用)
- STL之关联容器(pair、map、set的使用)
- C++中std::pair的使用
- std::set 使用
- std::set 使用
- std::set成员函数及简要使用方法
- c++map、set和pair使用小技巧
- 程序片段----std::set中使用自己定义的结构体需要重载小于号 20170904
- std::pair, std::copy, std::lower_bound, std::back_insert使用
- STL笔记(4)-set/multiset,functor,pair的使用方法
- 使用std::set作为用户自定义类型的…
- set 的简单使用和 pair 的简单介绍
- 【IDE】Eclipse中的workspace & workingset 如何更好的搭配使用,以及本地项目文件夹的分类
- STL之std::set、std::map的lower_bound和upper_bound函数使用说明
- C++ STL 有关于SET集合部分 的自定义数据类型的排序 以及 pair的使用