#ifndef PRINTH #define PRINTH #include #include using namespace std; template inline void print(const T& t); //declaration for non-member print in line 55 template struct _print { static void print(const T& t) {cout << t;} }; template <> struct _print { static void print(char c) {cout << "'" << c << "'";} }; template <> struct _print { static void print(const char *p) {cout << "\"" << p << "\"";} }; template struct _print { static void print(const T *p) { cout << p; if (p != 0) { cout << " -> "; ::print(*p); //call the non-member print (line 55) } } }; template struct _print > { static void print(const vector& v) { cout << "("; for (typename vector::const_iterator it = v.begin(); it != v.end(); ++it) { if (it != v.begin()) { cout << ", "; } ::print(*it); //call the non-member print (line 55) } cout << ")"; } }; template inline void print(const T& t) {_print::print(t);} //dispatching function #endif