C++ tuple
2016-11-14 17:34
120 查看
tuple
可以容纳多种不同的数据类型常常用于有多个返回值的情况
跟pair类似
代码
#include<iostream> #include<exception> #include<fstream> #include<sstream> #include<string> #include<vector> #include<iterator> #include<list> #include<deque> #include<stack> #include<queue> #include<concurrent_priority_queue.h> #include<algorithm> #include<numeric> #include<functional> //bind #include<map> #include<set> #include<unordered_map> #include<memory> #include<assert.h> #include<tuple> using namespace std; int main() { cout << "start!" << endl; tuple<int, string, double> tu(1,"233", 5.6); cout << get<1>(tu) << endl; get<1>(tu) = "ddd"; cout << get<1>(tu) << endl; cout << "end!" << endl; system("pause"); return EXIT_SUCCESS; }
*
get<1>(tu)返回的是对tuple数据的引用
相关文章推荐
- C++实现的Tuple类,非常好用
- python嵌入C++------ boost.python如何在C++中调用含有不定长参数tuple变量和关键字参数dict变量的函数
- C++ tuple 速记
- C++STL中的tuple 与 pair (piecewise construction)
- c++ tuple类型用法介绍
- c++ tuple模板学习
- C++中tuple类型
- C++ Has Become More Pythonic ( tuple & 可变模板参数 )
- C++ template —— tuple(十三)
- C++ 11 tuple & 可变参数模板
- c++ tr1和Boost中,tuple、tie的用法
- C++ 11 tuple & 可变参数模板
- Boost C++: 数据结构---tuple
- 对C++的改进之容器篇:array/multi_array/dynamic_bitset/Unordered/bimap/tuple/variant
- C++ std::pair, std::tuple
- C++ 11 tuple & 可变参数模板
- C++ - "tuple"(元组)容器 详解 及 代码
- C++ 11 tuple & 可变参数模板
- C++ tuple类型
- C++ 中的 "tuple"(元组)容器