mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-13 21:12:26 +00:00
LibGfx: Allow comparing Points, Sizes, and Rects of different type
This commit is contained in:
parent
67cda61b7f
commit
7278ff6605
Notes:
sideshowbarker
2024-07-18 22:59:44 +09:00
Author: https://github.com/nico
Commit: 7278ff6605
Pull-request: https://github.com/SerenityOS/serenity/pull/5054
3 changed files with 15 additions and 9 deletions
|
@ -107,12 +107,14 @@ public:
|
|||
return point;
|
||||
}
|
||||
|
||||
bool operator==(const Point<T>& other) const
|
||||
template<class U>
|
||||
bool operator==(const Point<U>& other) const
|
||||
{
|
||||
return m_x == other.m_x && m_y == other.m_y;
|
||||
return x() == other.x() && y() == other.y();
|
||||
}
|
||||
|
||||
bool operator!=(const Point<T>& other) const
|
||||
template<class U>
|
||||
bool operator!=(const Point<U>& other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue