| friends/point-with-friends-conversion/point.h - Class Point - header file. | Lecture 4 - slide 37 : 40 Program 1 |
// Class Point with Move as a Friend, and with implicit conversion from a double to Point.
class Point {
private:
double x, y;
public:
friend Point Move(const Point&, double, double);
Point(double, double);
Point(double); // We rely on this constructor in the example:
// Implicit conversion from double to point.
Point();
double getx () const;
double gety () const;
void move(double, double);
double distance_to(Point);
};
std::ostream& operator<<(std::ostream&, const Point&);