#ifndef TEMPLATEPAIR_H_ #define TEMPLATEPAIR_H_ #include using namespace std; template class Pair { public: Pair(T1 a_value, T2 b_value); T1 first() const; T2 second() const; private: T1 a; T2 b; }; template Pair::Pair(T1 a_value, T2 b_value) : a(a_value), b(b_value) {} template T1 Pair::first() const { return a; } template T2 Pair::second() const { return b; } template ostream& operator <<(ostream &outs, Pair& p) { outs << "(" << p.first() << ", " << p.second() << ")"; return outs; } #endif /* TEMPLATEPAIR_H_ */