From db28ed8f51e5730f89fc7268a2c9c79d26048f92 Mon Sep 17 00:00:00 2001 From: Jonne Ransijn Date: Fri, 15 Nov 2024 23:57:23 +0100 Subject: [PATCH] AK: Use `Noncopyable.h` in `NonnullRawPtr` --- AK/NonnullRawPtr.h | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/AK/NonnullRawPtr.h b/AK/NonnullRawPtr.h index fc4b9836833..a271160e0d8 100644 --- a/AK/NonnullRawPtr.h +++ b/AK/NonnullRawPtr.h @@ -7,12 +7,16 @@ #pragma once #include +#include #include namespace AK { template requires(!IsLvalueReference && !IsRvalueReference) class [[nodiscard]] NonnullRawPtr { + AK_MAKE_DEFAULT_COPYABLE(NonnullRawPtr); + AK_MAKE_DEFAULT_MOVABLE(NonnullRawPtr); + public: using ValueType = T; @@ -23,30 +27,6 @@ public: { } - NonnullRawPtr(NonnullRawPtr const& other) - : m_ptr(other.m_ptr) - { - } - - NonnullRawPtr(NonnullRawPtr&& other) - : m_ptr(other.m_ptr) - { - } - - NonnullRawPtr& operator=(NonnullRawPtr const& other) - { - m_ptr = other.m_ptr; - - return *this; - } - - NonnullRawPtr& operator=(NonnullRawPtr&& other) - { - m_ptr = other.m_ptr; - - return *this; - } - operator bool() const = delete; bool operator!() const = delete;