template class myPair { public: T first; U second; myPair(T first, U second) { this->first = first; this->second = second; } }; template std::ostream& operator<<(std::ostream &os, const myPair &p) { os << "(" << p.first << ", " << p.second << ")"; }