C++ tuple元组tie
#include <iostream>
#include <tuple>
int main()
{
std::tuple<int, char, float> tuple;
tuple = std::make_tuple(18, 'a', 2.5);
int a;
char b;
float c;
std::tie(a, b, c) = tuple;
std::cout << a << std::endl;
std::cout << b << std::endl;
std::cout << c << std::endl;
return 0;
}
# ./a.out
18
a
2.5