AK: Add comparison operators to NonnullRefPtr

This commit is contained in:
Allan Regush 2022-06-18 18:02:09 -06:00 committed by Sam Atkins
parent 61a703816c
commit ce7d868d6b

View file

@ -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;