diff --git a/Redcraft.Utility/Source/Public/Templates/Any.h b/Redcraft.Utility/Source/Public/Templates/Any.h index c242c71..d739dce 100644 --- a/Redcraft.Utility/Source/Public/Templates/Any.h +++ b/Redcraft.Utility/Source/Public/Templates/Any.h @@ -36,7 +36,7 @@ public: FORCEINLINE constexpr FAny(FInvalid) : FAny() { } - FORCEINLINE FAny(const FAny& InValue) + FAny(const FAny& InValue) : TypeInfo(InValue.TypeInfo) { if (!IsValid()) return; @@ -61,7 +61,7 @@ public: } } - FORCEINLINE FAny(FAny&& InValue) + FAny(FAny&& InValue) : TypeInfo(InValue.TypeInfo) { if (!IsValid()) return; @@ -102,7 +102,7 @@ public: Destroy(); } - FORCEINLINE FAny& operator=(const FAny& InValue) + FAny& operator=(const FAny& InValue) { if (&InValue == this) return *this; @@ -159,7 +159,7 @@ public: return *this; } - FORCEINLINE FAny& operator=(FAny&& InValue) + FAny& operator=(FAny&& InValue) { if (&InValue == this) return *this; @@ -276,7 +276,7 @@ public: Invalidate(); } - FORCEINLINE void Swap(FAny& InValue) + void Swap(FAny& InValue) { if (!IsValid() && !InValue.IsValid()) return; @@ -472,7 +472,7 @@ private: } template - FORCEINLINE void EmplaceImpl(Ts&&... Args) + void EmplaceImpl(Ts&&... Args) { using DecayedType = TDecay; @@ -505,7 +505,7 @@ private: } } - FORCEINLINE void Destroy() + void Destroy() { if (!IsValid()) return; diff --git a/Redcraft.Utility/Source/Public/Templates/Function.h b/Redcraft.Utility/Source/Public/Templates/Function.h index 05678a5..d63ae06 100644 --- a/Redcraft.Utility/Source/Public/Templates/Function.h +++ b/Redcraft.Utility/Source/Public/Templates/Function.h @@ -103,7 +103,7 @@ public: FORCEINLINE constexpr TFunctionStorage() = default; - FORCEINLINE TFunctionStorage(const TFunctionStorage& InValue) requires (!bIsUnique) + TFunctionStorage(const TFunctionStorage& InValue) requires (!bIsUnique) : RTTI(InValue.RTTI) { if (!IsValid()) return; @@ -128,7 +128,7 @@ public: } } - FORCEINLINE TFunctionStorage(TFunctionStorage&& InValue) + TFunctionStorage(TFunctionStorage&& InValue) : RTTI(InValue.RTTI) { if (!IsValid()) return; @@ -158,7 +158,7 @@ public: Destroy(); } - FORCEINLINE TFunctionStorage& operator=(const TFunctionStorage& InValue) requires (!bIsUnique) + TFunctionStorage& operator=(const TFunctionStorage& InValue) requires (!bIsUnique) { if (&InValue == this) return *this; @@ -195,7 +195,7 @@ public: return *this; } - FORCEINLINE TFunctionStorage& operator=(TFunctionStorage&& InValue) + TFunctionStorage& operator=(TFunctionStorage&& InValue) { if (&InValue == this) return *this; @@ -238,7 +238,7 @@ public: FORCEINLINE constexpr bool IsValid() const { return RTTI != 0; } // Use Invalidate() to invalidate the storage or use Emplace() to emplace a new object after destruction. - FORCEINLINE void Destroy() + void Destroy() { if (!IsValid()) return; @@ -263,7 +263,7 @@ public: // Make sure you call this function after you have destroyed the held object using Destroy(). template - FORCEINLINE void Emplace(uintptr InCallable, Ts&&... Args) + void Emplace(uintptr InCallable, Ts&&... Args) { Callable = InCallable; @@ -295,7 +295,7 @@ public: } - FORCEINLINE void Swap(TFunctionStorage& InValue) + void Swap(TFunctionStorage& InValue) { if (!IsValid() && !InValue.IsValid()) return; diff --git a/Redcraft.Utility/Source/Public/Templates/Optional.h b/Redcraft.Utility/Source/Public/Templates/Optional.h index b448b44..8ec76ed 100644 --- a/Redcraft.Utility/Source/Public/Templates/Optional.h +++ b/Redcraft.Utility/Source/Public/Templates/Optional.h @@ -96,7 +96,7 @@ public: FORCEINLINE constexpr TOptional& operator=(const TOptional& InValue) requires (CTriviallyCopyConstructible && CTriviallyCopyAssignable) = default; - FORCEINLINE constexpr TOptional& operator=(const TOptional& InValue) requires (CCopyConstructible && CCopyAssignable + constexpr TOptional& operator=(const TOptional& InValue) requires (CCopyConstructible && CCopyAssignable && !CTriviallyCopyConstructible && !CTriviallyCopyAssignable) { if (&InValue == this) return *this; @@ -119,7 +119,7 @@ public: FORCEINLINE constexpr TOptional& operator=(TOptional&& InValue) requires (CTriviallyMoveConstructible && CTriviallyMoveAssignable) = default; - FORCEINLINE constexpr TOptional& operator=(TOptional&& InValue) requires (CMoveConstructible && CMoveAssignable + constexpr TOptional& operator=(TOptional&& InValue) requires (CMoveConstructible && CMoveAssignable && !CTriviallyMoveConstructible && !CTriviallyMoveAssignable) { if (&InValue == this) return *this; @@ -142,7 +142,7 @@ public: template requires (CConstructibleFrom && CAssignableFrom && NAMESPACE_PRIVATE::CTOptionalAllowUnwrappable) - FORCEINLINE constexpr TOptional& operator=(const TOptional& InValue) + constexpr TOptional& operator=(const TOptional& InValue) { if (!InValue.IsValid()) { @@ -162,7 +162,7 @@ public: template requires (CConstructibleFrom && CAssignableFrom && NAMESPACE_PRIVATE::CTOptionalAllowUnwrappable) - FORCEINLINE constexpr TOptional& operator=(TOptional&& InValue) + constexpr TOptional& operator=(TOptional&& InValue) { if (!InValue.IsValid()) { @@ -241,7 +241,7 @@ public: } template requires (CMoveConstructible && CSwappable) - FORCEINLINE constexpr void Swap(TOptional& InValue) + constexpr void Swap(TOptional& InValue) { if (!IsValid() && !InValue.IsValid()) return; diff --git a/Redcraft.Utility/Source/Public/Templates/Variant.h b/Redcraft.Utility/Source/Public/Templates/Variant.h index ea05476..70ee64e 100644 --- a/Redcraft.Utility/Source/Public/Templates/Variant.h +++ b/Redcraft.Utility/Source/Public/Templates/Variant.h @@ -133,7 +133,7 @@ public: FORCEINLINE constexpr TVariant& operator=(const TVariant& InValue) requires (true && ... && (CTriviallyCopyConstructible && CTriviallyCopyAssignable)) = default; - FORCEINLINE constexpr TVariant& operator=(const TVariant& InValue) requires ((true && ... && (CCopyConstructible && CCopyAssignable)) + constexpr TVariant& operator=(const TVariant& InValue) requires ((true && ... && (CCopyConstructible && CCopyAssignable)) && !(true && ... && (CTriviallyCopyConstructible && CTriviallyCopyAssignable))) { if (&InValue == this) return *this; @@ -157,7 +157,7 @@ public: FORCEINLINE constexpr TVariant& operator=(TVariant&& InValue) requires (true && ... && (CTriviallyMoveConstructible && CTriviallyMoveAssignable)) = default; - FORCEINLINE constexpr TVariant& operator=(TVariant&& InValue) requires ((true && ... && (CMoveConstructible && CMoveAssignable)) + constexpr TVariant& operator=(TVariant&& InValue) requires ((true && ... && (CMoveConstructible && CMoveAssignable)) && !(true && ... && (CTriviallyMoveConstructible && CTriviallyMoveAssignable))) { if (&InValue == this) return *this; @@ -263,7 +263,7 @@ public: return HashCombine(GetTypeHash(GetIndex()), HashImpl[GetIndex()](&Value)); } - FORCEINLINE constexpr void Swap(TVariant& InValue) requires (true && ... && (CMoveConstructible && CSwappable)) + constexpr void Swap(TVariant& InValue) requires (true && ... && (CMoveConstructible && CSwappable)) { if (!IsValid() && !InValue.IsValid()) return; @@ -317,7 +317,7 @@ private: TAlignedUnion<1, Ts...> Value; uint8 TypeIndex; - friend FORCEINLINE constexpr bool operator==(const TVariant& LHS, const TVariant& RHS) requires (true && ... && CEqualityComparable) + friend constexpr bool operator==(const TVariant& LHS, const TVariant& RHS) requires (true && ... && CEqualityComparable) { if (LHS.GetIndex() != RHS.GetIndex()) return false; if (LHS.IsValid() == false) return true; @@ -328,7 +328,7 @@ private: return CompareImpl[LHS.GetIndex()](&LHS.Value, &RHS.Value); } - friend FORCEINLINE constexpr partial_ordering operator<=>(const TVariant& LHS, const TVariant& RHS) requires (true && ... && CSynthThreeWayComparable) + friend constexpr partial_ordering operator<=>(const TVariant& LHS, const TVariant& RHS) requires (true && ... && CSynthThreeWayComparable) { if (LHS.GetIndex() != RHS.GetIndex()) return partial_ordering::unordered; if (LHS.IsValid() == false) return partial_ordering::equivalent; @@ -485,7 +485,7 @@ NAMESPACE_PRIVATE_END template requires (CTVariant> && (true && ... && CTVariant>)) -FORCEINLINE constexpr decltype(auto) Visit(F&& Func, FirstVariantType&& FirstVariant, VariantTypes&&... Variants) +constexpr decltype(auto) Visit(F&& Func, FirstVariantType&& FirstVariant, VariantTypes&&... Variants) { checkf((true && ... && Variants.IsValid()), TEXT("It is an error to call Visit() on an wrong TVariant. Please either check IsValid().")); return NAMESPACE_PRIVATE::TVariantVisitImpl::Do(Forward(Func), Forward(FirstVariant), Forward(Variants)...); @@ -493,7 +493,7 @@ FORCEINLINE constexpr decltype(auto) Visit(F&& Func, FirstVariantType&& FirstVar template requires (CTVariant> && (true && ... && CTVariant>)) -FORCEINLINE constexpr Ret Visit(F&& Func, FirstVariantType&& FirstVariant, VariantTypes&&... Variants) +constexpr Ret Visit(F&& Func, FirstVariantType&& FirstVariant, VariantTypes&&... Variants) { checkf((true && ... && Variants.IsValid()), TEXT("It is an error to call Visit() on an wrong TVariant. Please either check IsValid().")); return NAMESPACE_PRIVATE::TVariantVisitImpl::template Result::Do(Forward(Func), Forward(FirstVariant), Forward(Variants)...);