summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2022-03-29 16:02:54 +0300
committerAndreas Kling <kling@serenityos.org>2022-03-29 17:45:36 +0200
commitb75ed992a651825d7105266a3c23fb49f6585dd9 (patch)
treed33668a72a420c1c10eec59666741c837f0c06b5 /Userland
parent1d522e4b4ce27e1fe5ad42fc9f2538e0212442dd (diff)
downloadserenity-b75ed992a651825d7105266a3c23fb49f6585dd9.zip
LibGUI: Add operators >,>= to TextPosition
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGUI/TextPosition.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/TextPosition.h b/Userland/Libraries/LibGUI/TextPosition.h
index f650c1c6ca..e779a02432 100644
--- a/Userland/Libraries/LibGUI/TextPosition.h
+++ b/Userland/Libraries/LibGUI/TextPosition.h
@@ -30,6 +30,8 @@ public:
bool operator==(const TextPosition& other) const { return m_line == other.m_line && m_column == other.m_column; }
bool operator!=(const TextPosition& other) const { return m_line != other.m_line || m_column != other.m_column; }
bool operator<(const TextPosition& other) const { return m_line < other.m_line || (m_line == other.m_line && m_column < other.m_column); }
+ bool operator>(const TextPosition& other) const { return *this != other && !(*this < other); }
+ bool operator>=(const TextPosition& other) const { return *this > other || (*this == other); }
private:
size_t m_line { 0xffffffff };