85、增强的元组

在 C++ 中本已有⼀个 pair 模板可以定义⼆元组, C++11 更进⼀步地提供了边⻓参数的 tuple 模板:

typedef std::tuple< int , double, string > tuple_1 t1;
typedef std::tuple< char, short , const char * > tuple_2 t2 ('X', 2,
"Hola!");
t1 = t2 ; // 隐式类型转换

Last updated