| templates/functions/vers2/point.h - Class Point with comparison operator friends. | Lecture 5 - slide 35 : 40 Program 2 |
// Preparing for definition of operator< in class Point.
class Point {
private:
double x, y;
public:
Point(double, double);
Point();
double getx () const;
double gety () const;
void move(double, double);
double distance_to(Point);
friend bool operator<(const Point&, const Point&);
};
std::ostream& operator<<(std::ostream&, const Point&);