diff --git a/AK/NonnullOwnPtr.h b/AK/NonnullOwnPtr.h index efb3fef7044..f1f07011a68 100644 --- a/AK/NonnullOwnPtr.h +++ b/AK/NonnullOwnPtr.h @@ -121,6 +121,9 @@ public: CALLABLE_WHEN(unconsumed) operator T*() { return m_ptr; } + operator bool() const = delete; + bool operator!() const = delete; + private: void clear() { diff --git a/AK/NonnullRefPtr.h b/AK/NonnullRefPtr.h index 812457a01ad..90ad50ca751 100644 --- a/AK/NonnullRefPtr.h +++ b/AK/NonnullRefPtr.h @@ -221,6 +221,9 @@ public: return *m_ptr; } + operator bool() const = delete; + bool operator!() const = delete; + private: NonnullRefPtr() = delete;