| application-operator-overload/vers2/point.h - Class Point with another overloading of the application operator. | Lecture 6 - slide 21 : 40 Program 4 |
// Another example - another overload of the Point application operator, as applied on int.
class Point {
private:
double x, y;
public:
Point();
Point(double);
Point(double, double);
double getx () const;
double gety () const;
void move(double, double);
double distance_to(Point);
double operator()(int i) const; // Accesses x or y
};
class IndexProblem{};
std::ostream& operator<<(std::ostream&, const Point&);