The class template tuple<> is a generalization of the STL pair, which can hold N elements of types T1, T2, .. TN.
Template function make_tuple:
#include <tr1/functional> using std::tr1::ref; using std::tr1::cref; tuple<int,int> x (make_tuple(1,2)); make_tuple(ref(x), cref(y));
#include <tr1/functional> tie(x,y); // create a tuple<int &, int &> tuple<int &,int &> ij = tie(i,j); std::tr1::get<0>(ij) = 1; std::tr1::get<1>(ij) = 2; tie(i, ignore) = make_tuple(1,2);
using std::tr1::tuple_size; typedef tuple<int,int> myTuple; tuple_size<myTuple>::value;
Metafunction tuple_element:
using std::tr1::tuple_element; typedef tuple<int,int> myTuple; tuple_element<0,myTuple>::type tuple_element<1,myTuple>::type
Lexicographical comparisons:
== != < <= > >=
|
|