From ce7d868d6b1526d26bfaf532f7a151b8482c271d Mon Sep 17 00:00:00 2001 From: Allan Regush Date: Sat, 18 Jun 2022 18:02:09 -0600 Subject: [PATCH] AK: Add comparison operators to NonnullRefPtr --- AK/NonnullRefPtr.h | 6 ++++++ 1 file changed, 6 insertions(+) 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;