mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
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:
parent
0ecd09e7ff
commit
2f2435dd34
2 changed files with 3 additions and 3 deletions
|
@ -108,14 +108,14 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator== (const GlPoint& rhs)
|
bool operator== (const GlPoint& rhs) const
|
||||||
{
|
{
|
||||||
if (&rhs == this) return true;
|
if (&rhs == this) return true;
|
||||||
if (rhs.x == this->x && rhs.y == this->y) return true;
|
if (rhs.x == this->x && rhs.y == this->y) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!= (const GlPoint& rhs)
|
bool operator!= (const GlPoint& rhs) const
|
||||||
{
|
{
|
||||||
if (&rhs == this) return true;
|
if (&rhs == this) return true;
|
||||||
if (rhs.x != this->x || rhs.y != this->y) return true;
|
if (rhs.x != this->x || rhs.y != this->y) return true;
|
||||||
|
|
|
@ -103,7 +103,7 @@ struct RenderRegion
|
||||||
void intersect(const RenderRegion& rhs);
|
void intersect(const RenderRegion& rhs);
|
||||||
void add(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;
|
if (x == rhs.x && y == rhs.y && w == rhs.w && h == rhs.h) return true;
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue