From f79165cefe76de2a52bb0fd7492cd5e8cfa1649a Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Tue, 20 Jun 2023 13:25:48 -0400 Subject: [PATCH] AK: Make `FixedArray` movable --- AK/FixedArray.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/AK/FixedArray.h b/AK/FixedArray.h index 08c8200580..55ca1554b9 100644 --- a/AK/FixedArray.h +++ b/AK/FixedArray.h @@ -89,8 +89,13 @@ public: : m_storage(exchange(other.m_storage, nullptr)) { } - // This function would violate the contract, as it would need to deallocate this FixedArray. As it also has no use case, we delete it. - FixedArray& operator=(FixedArray&&) = delete; + + FixedArray& operator=(FixedArray&& other) + { + m_storage = other.m_storage; + other.m_storage = nullptr; + return *this; + } ~FixedArray() {