// The general implementation of the Point template class. #include #include #include "point.h" template Point::Point(C x_coord, C y_coord): x(x_coord), y(y_coord){ } template Point::Point(): x(C()), y(C()){ // int() is 0 ... } template C Point::getx () const{ return x; } template C Point::gety () const{ return y; } template Point& Point::move(C dx, C dy){ x += dx; y += dy; return *this; } template double Point::distance_to(Point p){ return sqrt((x - p.x) * (x - p.x) + (y - p.y) * (y - p.y)); } template std::ostream& operator<< (std::ostream& s, const Point& p){ return s << "(" << p.x << "," << p.y << ")" ; }