1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:47:35 +00:00

LibGfx: Allow comparing Points, Sizes, and Rects of different type

This commit is contained in:
Nico Weber 2021-01-22 15:12:37 -05:00 committed by Andreas Kling
parent 67cda61b7f
commit 7278ff6605
3 changed files with 15 additions and 9 deletions

View file

@ -74,12 +74,14 @@ public:
return other.m_width <= m_width && other.m_height <= m_height;
}
bool operator==(const Size<T>& other) const
template<class U>
bool operator==(const Size<U>& other) const
{
return m_width == other.m_width && m_height == other.m_height;
return width() == other.width() && height() == other.height();
}
bool operator!=(const Size<T>& other) const
template<class U>
bool operator!=(const Size<U>& other) const
{
return !(*this == other);
}