summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Regush <allan@allanregush.com>2022-06-18 18:02:09 -0600
committerSam Atkins <atkinssj@gmail.com>2022-07-09 09:32:51 +0100
commitce7d868d6b1526d26bfaf532f7a151b8482c271d (patch)
treedcb81371831467b353ef7c4d283e412598c1318a
parent61a703816cdae1569ef66b146fe8045832ec9c63 (diff)
downloadserenity-ce7d868d6b1526d26bfaf532f7a151b8482c271d.zip
AK: Add comparison operators to NonnullRefPtr
-rw-r--r--AK/NonnullRefPtr.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/AK/NonnullRefPtr.h b/AK/NonnullRefPtr.h
index 021b72eb0a..fa107b35a7 100644
--- a/AK/NonnullRefPtr.h
+++ b/AK/NonnullRefPtr.h
@@ -218,6 +218,12 @@ public:
AK::swap(m_ptr, other.m_ptr);
}
+ bool operator==(NonnullRefPtr const& other) const { return m_ptr == other.m_ptr; }
+ bool operator!=(NonnullRefPtr const& other) const { return m_ptr != other.m_ptr; }
+
+ bool operator==(NonnullRefPtr& other) { return m_ptr == other.m_ptr; }
+ bool operator!=(NonnullRefPtr& other) { return m_ptr != other.m_ptr; }
+
// clang-format off
private:
NonnullRefPtr() = delete;