Suppose I define this structure:
struct Point { double x, y; };
How can I overload the + operator so that, declared,
+
This will also work:
struct Point{ double x,y; Point& operator+(const Point& rhs){ x += rhs.x; y += rhs.y; return *this; } }