Add add/assign operator to point
This commit is contained in:
parent
91daeb332f
commit
d6f0fd956c
@ -43,3 +43,12 @@ point::manhattan (const point &other) const {
|
||||
return fabs (x - other.x) +
|
||||
fabs (y - other.y);
|
||||
}
|
||||
|
||||
|
||||
point&
|
||||
point::operator+= (const point &rhs) {
|
||||
x += rhs.x;
|
||||
y += rhs.y;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user