Skip to content
Snippets Groups Projects
Commit 831435ec authored by Ian Prins's avatar Ian Prins
Browse files

fix augmented assignment

parent fb0d86ec
No related branches found
No related tags found
No related merge requests found
......@@ -34,12 +34,14 @@ Coord Coord::operator-(const Coord& other) {
return Coord(this->x - other.x, this->y - other.y);
}
Coord Coord::operator+=(const Coord& other) {
return *this + other;
Coord& Coord::operator+=(const Coord& other) {
*this = *this + other;
return *this;
}
Coord Coord::operator-=(const Coord& other) {
return *this - other;
Coord& Coord::operator-=(const Coord& other) {
*this = *this - other;
return *this;
}
bool Coord::operator==(const Coord& other) {
......
......@@ -9,8 +9,8 @@ class Coord {
int& operator[](int);
Coord operator+(const Coord&);
Coord operator-(const Coord&);
Coord operator+=(const Coord&);
Coord operator-=(const Coord&);
Coord& operator+=(const Coord&);
Coord& operator-=(const Coord&);
bool operator==(const Coord&);
bool operator!=(const Coord&);
Coord copy();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment