Listing 2
#include <tuple> #include <iomanip> #include <iostream> using std::tr1::tuple; using std::tr1::get; using std::cout; using std::boolalpha; int main() { // demonstrate template function get tuple<int, double, bool> tpl(1, 2.1, true); cout << boolalpha << get<0>(tpl) << ' ' << get<1>(tpl) << ' ' << get<2>(tpl) << '\n'; return 0; }