Listing 3
#include <tuple> #include <utility> #include <iostream> #include <typeinfo> using std::tr1::make_tuple; using std::tr1::ref; using std::cout; template <class T> void show_type(T t) { // show the implementation-specific name of a type cout << typeid(t).name() << "\n\n"; } int main() { // demonstrate use of make_tuple show_type(make_tuple(1, 2.1)); int a = 1, b = 2; show_type(make_tuple(a, b)); show_type(make_tuple(ref(a), ref(b))); return 0; }