| application-operator-overload/vers1/point.h - Class Point with overloadings of the application operator. | Lecture 6 - slide 21 : 40 Program 1 |
// Class Point becomes a function object, because it can be called as a function.
// Class Point with two overloads of the function call operator, operator().
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);
double operator()(int) const;
double operator()(Point) const;
};
std::ostream& operator<<(std::ostream&, const Point&);