vec2 bool comparisons should be const

This commit is contained in:
Noel Berry 2021-01-11 00:25:51 -08:00
parent 6aa9d3b412
commit 1063f1ff29
2 changed files with 4 additions and 4 deletions

View File

@ -31,8 +31,8 @@ namespace Blah
Vec2& operator /=(float rhs);
Vec2& operator *=(float rhs);
bool operator ==(const Vec2& rhs);
bool operator !=(const Vec2& rhs);
bool operator ==(const Vec2& rhs) const;
bool operator !=(const Vec2& rhs) const;
Vec2 normal() const;
Vec2 turn_right() const;

View File

@ -25,8 +25,8 @@ Vec2& Vec2::operator *=(const Vec2& rhs) { x *= rhs.x; y *= rhs.y; return *this;
Vec2& Vec2::operator/=(float rhs) { x /= rhs; y /= rhs; return *this; }
Vec2& Vec2::operator*=(float rhs) { x *= rhs; y *= rhs; return *this; }
bool Vec2::operator ==(const Vec2& rhs) { return x == rhs.x && y == rhs.y; }
bool Vec2::operator !=(const Vec2& rhs) { return x != rhs.x || y != rhs.y; }
bool Vec2::operator ==(const Vec2& rhs) const { return x == rhs.x && y == rhs.y; }
bool Vec2::operator !=(const Vec2& rhs) const { return x != rhs.x || y != rhs.y; }
Vec2 Vec2::normal() const
{