#include using namespace std; template class point; template ostream& operator<<(ostream& out, point p) { out << "(" << p.x <<"," << p.y << ") " ; return out; } template < class T> class point { public: point():x(0), y(0){} point(T a, T b = 0):x(a), y(b){} void print()const{cout << "(" << x << "," << y << ") ";} template < typename T2 > friend ostream& operator<<(ostream& out, point p); private: T x, y; }; int main() { // template simple class cout << "use of simple template class"<< endl; point a(8,9); a.print(); cout << endl; cout << a << endl; point b(3.5); b.print(); cout << endl; point< point > c(a, a); cout << c << endl; c.print(); cout << endl; return 0; }