pair类
来源:互联网 发布:屠龙大陆翅膀进阶数据 编辑:程序博客网 时间:2024/05/22 10:38
原文地址:http://blog.csdn.net/oceanlight/article/details/7890537
pair的类型:
pair 是 一种模版类型。每个pair 可以存储两个值。这两种值无限制。也可以将自己写的struct的对象放进去。。pair<string,int> p;pair<int ,int > p;
pair
template <class T1, class T2> struct pair { typedef T1 first_type; typedef T2 second_type; T1 first; T2 second; pair() : first(T1()), second(T2()) {} pair(const T1& x, const T2& y) : first(x), second(y) {} template <class U, class V> pair (const pair<U,V> &p) : first(p.first), second(p.second) { } } template <class T1, class T2> struct pair{ typedef T1 first_type; typedef T2 second_type; T1 first; T2 second; pair() : first(T1()), second(T2()) {} pair(const T1& x, const T2& y) : first(x), second(y) {} template <class U, class V> pair (const pair<U,V> &p) : first(p.first), second(p.second) { }}
(补充:以下是网上搜的)
由于pair类型的使用比较繁琐,因为如果要定义多个形同的pair类型的时候,可以时候typedef简化声明:
typedef pair
0 0
- pair类
- pair
- pair
- Pair
- Pair
- pair
- Android学习之Pair类 (android.util.Pair )
- c++ stl pair类用法
- STL中的模板类pair
- 创建Java中的Pair类
- STL中的模板类pair 和map
- STL中的模板类pair 和map
- 类模板带参数,list,pair
- [STL基础]pair组对单位模板类
- STL中的模板类pair ,make_pair和map
- c++ 中pair类模板的用法详解
- c++ 中pair类模板的用法详解
- Code-Pair
- 一次艰难的ASP.NET生成Excel文件的历程总结
- Maven - Build Lifecycle
- 解决jquery插件冲突的问题
- 三++28
- php 网页转 word 文件
- pair类
- Concise,一款为hexo设计的简约而漂亮的主题
- LeetCode 7.Reverse integer
- 编程之美2.1——求二进制数中1的个数
- linux字符设备基本框架--原文地址http://blog.chinaunix.net/uid-25424552-id-3387451.html
- java集合框架---Map总结
- HDU1075 What Are You Talking About 【Map容器】
- java第三天,代码好多哦~~
- java数据引擎(八):应用一