From fd4f363fe2f4c1e675cfa30b1d7d9c777e7d410f Mon Sep 17 00:00:00 2001 From: yuriy0 Date: Fri, 25 Jun 2021 18:32:27 -0400 Subject: [PATCH] Don't give a broken copy constructor to BehaviorContextObject. (#1002) * Don't give a broken copy constructor to BehaviorContextObject. This used to be required by the serialization system, now it handles non-copyable and non-moveable types. * Explicitly delete the copy constructor instead of defaulting, which implicitly deletes it. Some compilers complain about such an implicit deletion, and we should be explicit about our intent anyways Signed-off-by: John --- .../Include/ScriptCanvas/Data/BehaviorContextObject.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/BehaviorContextObject.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/BehaviorContextObject.h index a6c7c33663..882d05e227 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/BehaviorContextObject.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/BehaviorContextObject.h @@ -120,6 +120,7 @@ namespace ScriptCanvas AZ_FORCE_INLINE BehaviorContextObject() = default; BehaviorContextObject& operator=(const BehaviorContextObject&) = delete; + BehaviorContextObject(const BehaviorContextObject&) = delete; // copy ctor AZ_FORCE_INLINE BehaviorContextObject(const void* source, const AnyTypeInfo& typeInfo, AZ::u32 flags); @@ -138,13 +139,6 @@ namespace ScriptCanvas AZ_FORCE_INLINE void add_ref(); void release(); - - public: - // no copying allowed, this is here to allow compile time compatibility with storage in of BehaviorContextObjectPtr AZStd::any, only - AZ_FORCE_INLINE BehaviorContextObject(const BehaviorContextObject&) - { - AZ_Assert(false, "no copying allowed, this is here to allow storage in of BehaviorContextObjectPtr AZStd::any, only"); - } }; AZ_FORCE_INLINE BehaviorContextObject::BehaviorContextObject(const void* value, const AnyTypeInfo& typeInfo, AZ::u32 flags)