Explorar o código

AK: Add comparison operators to NonnullRefPtr

Allan Regush %!s(int64=3) %!d(string=hai) anos
pai
achega
ce7d868d6b
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      AK/NonnullRefPtr.h

+ 6 - 0
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;