1#include <iostream>
2#include <string>
3#include <tuple>
4
5auto t = std::make_tuple(1, "Foo", 3.14);
6// index-based access
7std::cout << "(" << std::get<0>(t) << ", " << std::get<1>(t)<< ", " << std::get<2>(t) << ")\n";
8// type-based access (C++14 or later)
9std::cout << "(" << std::get<int>(t) << ", " << std::get<const char*>(t) << ", " << std::get<double>(t) << ")\n";
10