common: ensure const equality operators

A minor syntactic adjustment to two instances of operator== and one instance of operator!=, both to the end of ensuring these locally-scoped functions are properly identified as const. In the majority of cases, this shouldn't have any impact; however, this change makes these operators play nice in c++20 contexts.
This commit is contained in:
Thaddeus Crews 2024-06-28 21:39:25 -05:00 committed by Hermet Park
parent 0ecd09e7ff
commit 2f2435dd34
2 changed files with 3 additions and 3 deletions

View file

@ -108,14 +108,14 @@ public:
return *this;
}
bool operator== (const GlPoint& rhs)
bool operator== (const GlPoint& rhs) const
{
if (&rhs == this) return true;
if (rhs.x == this->x && rhs.y == this->y) return true;
return false;
}
bool operator!= (const GlPoint& rhs)
bool operator!= (const GlPoint& rhs) const
{
if (&rhs == this) return true;
if (rhs.x != this->x || rhs.y != this->y) return true;

View file

@ -103,7 +103,7 @@ struct RenderRegion
void intersect(const RenderRegion& rhs);
void add(const RenderRegion& rhs);
bool operator==(const RenderRegion& rhs)
bool operator==(const RenderRegion& rhs) const
{
if (x == rhs.x && y == rhs.y && w == rhs.w && h == rhs.h) return true;
return false;