diff --git a/Redcraft.Utility/Source/Public/Templates/ReferenceWrapper.h b/Redcraft.Utility/Source/Public/Templates/ReferenceWrapper.h index 1d20d18..70f8114 100644 --- a/Redcraft.Utility/Source/Public/Templates/ReferenceWrapper.h +++ b/Redcraft.Utility/Source/Public/Templates/ReferenceWrapper.h @@ -25,20 +25,18 @@ public: } FORCEINLINE constexpr TReferenceWrapper(const TReferenceWrapper&) = default; + FORCEINLINE constexpr TReferenceWrapper(TReferenceWrapper&&) = default; template requires (CConvertibleTo) FORCEINLINE constexpr TReferenceWrapper(const TReferenceWrapper& InValue) : Pointer(InValue.Pointer) { } - FORCEINLINE constexpr TReferenceWrapper& operator=(const TReferenceWrapper&) = default; - - template requires (CConvertibleTo) - FORCEINLINE constexpr TReferenceWrapper& operator=(const TReferenceWrapper& InValue) - { - Pointer = InValue.Pointer; - return *this; - } + template requires (CAssignableFrom) + FORCEINLINE constexpr TReferenceWrapper& operator=(T&& Object) { Get() = Forward(Object); return *this; } + + FORCEINLINE constexpr TReferenceWrapper& operator=(const TReferenceWrapper&) = delete; + FORCEINLINE constexpr TReferenceWrapper& operator=(TReferenceWrapper&&) = delete; FORCEINLINE constexpr operator ReferencedType&() const { return *Pointer; } FORCEINLINE constexpr ReferencedType& Get() const { return *Pointer; }