class Point {
public:
int x, y;
Point operator+(const Point& other) {
Point result;
result.x = x + other.x;
result.y = y + other.y;
return result;
}
};
...
Point p1{1, 2};
Point p2{3, 4};
Point p3 = p1 + p2; //Point p3 = p1.operator+(p2);