From f521c2b5d5525e0db540ba4be36121c331a73edd Mon Sep 17 00:00:00 2001 From: _Redstone_c_ Date: Fri, 17 Feb 2023 23:31:24 +0800 Subject: [PATCH] fix(templates): fix FNoncopyable to satisfy the CMovable concept --- .../Source/Public/Templates/Noncopyable.h | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Redcraft.Utility/Source/Public/Templates/Noncopyable.h b/Redcraft.Utility/Source/Public/Templates/Noncopyable.h index ab98b55..53da1a2 100644 --- a/Redcraft.Utility/Source/Public/Templates/Noncopyable.h +++ b/Redcraft.Utility/Source/Public/Templates/Noncopyable.h @@ -9,17 +9,21 @@ NAMESPACE_MODULE_BEGIN(Utility) /** A class indicates that a derived class cannot be copied. */ struct FNoncopyable { - FNoncopyable() = default; - FNoncopyable(const FNoncopyable&) = delete; + FNoncopyable() = default; + FNoncopyable(const FNoncopyable&) = delete; + FNoncopyable(FNoncopyable&&) = default; FNoncopyable& operator=(const FNoncopyable&) = delete; + FNoncopyable& operator=(FNoncopyable&&) = default; }; /** A class indicates that a derived class cannot be moved. */ struct FNonmovable { - FNonmovable() = default; - FNonmovable(FNonmovable&&) = delete; - FNonmovable& operator=(FNonmovable&&) = delete; + FNonmovable() = default; + FNonmovable(const FNonmovable&) = default; + FNonmovable(FNonmovable&&) = delete; + FNonmovable& operator=(const FNonmovable&) = default; + FNonmovable& operator=(FNonmovable&&) = delete; }; /** A class indicates that a derived class cannot be copied or moved. */ @@ -27,11 +31,11 @@ struct FSingleton // : FNoncopyable, FNonmovable { // NOTE: Multiple inheritance is no longer used here, as that would break the EBO in MSVC - FSingleton() = default; - FSingleton(const FSingleton&) = delete; - FSingleton(FSingleton&&) = delete; + FSingleton() = default; + FSingleton(const FSingleton&) = delete; + FSingleton(FSingleton&&) = delete; FSingleton& operator=(const FSingleton&) = delete; - FSingleton& operator=(FSingleton&&) = delete; + FSingleton& operator=(FSingleton&&) = delete; }; NAMESPACE_MODULE_END(Utility)