operators/vers1/point.h - Class Point with operators as members. | Lecture 4 - slide 40 : 40 Program 1 |
// Operator overloading - as members. 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) const; Point operator+(const Point&); Point operator++(int); // int means Postfix ++ bool operator==(const Point&); }; std::ostream& operator<<(std::ostream&, const Point&);