From e1871de73b62cbe6897ecbf9b16322dbaa48a5d4 Mon Sep 17 00:00:00 2001 From: _Redstone_c_ Date: Sat, 26 Mar 2022 19:31:45 +0800 Subject: [PATCH] perf(templates): fix the redefinition of Swap function in private namespaces --- Redcraft.Utility/Source/Public/Templates/Invoke.h | 3 +-- Redcraft.Utility/Source/Public/Templates/Optional.h | 1 + Redcraft.Utility/Source/Public/Templates/Utility.h | 4 +++- Redcraft.Utility/Source/Public/TypeTraits/Swappable.h | 5 +---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Redcraft.Utility/Source/Public/Templates/Invoke.h b/Redcraft.Utility/Source/Public/Templates/Invoke.h index 9b2eeb6..af53d68 100644 --- a/Redcraft.Utility/Source/Public/Templates/Invoke.h +++ b/Redcraft.Utility/Source/Public/Templates/Invoke.h @@ -1,8 +1,7 @@ #pragma once #include "CoreTypes.h" -#include "TypeTraits/Miscellaneous.h" - +#include "TypeTraits/TypeTraits.h" NAMESPACE_REDCRAFT_BEGIN NAMESPACE_MODULE_BEGIN(Redcraft) diff --git a/Redcraft.Utility/Source/Public/Templates/Optional.h b/Redcraft.Utility/Source/Public/Templates/Optional.h index 550694a..2fb7608 100644 --- a/Redcraft.Utility/Source/Public/Templates/Optional.h +++ b/Redcraft.Utility/Source/Public/Templates/Optional.h @@ -1,6 +1,7 @@ #pragma once #include "CoreTypes.h" +#include "Templates/Utility.h" #include "Concepts/Comparable.h" #include "TypeTraits/TypeTraits.h" #include "Miscellaneous/AssertionMacros.h" diff --git a/Redcraft.Utility/Source/Public/Templates/Utility.h b/Redcraft.Utility/Source/Public/Templates/Utility.h index 767c29a..d5c7e6b 100644 --- a/Redcraft.Utility/Source/Public/Templates/Utility.h +++ b/Redcraft.Utility/Source/Public/Templates/Utility.h @@ -1,7 +1,9 @@ #pragma once #include "CoreTypes.h" -#include "TypeTraits/TypeTraits.h" +#include "TypeTraits/CompositeType.h" +#include "TypeTraits/Miscellaneous.h" +#include "TypeTraits/SupportedOperations.h" NAMESPACE_REDCRAFT_BEGIN NAMESPACE_MODULE_BEGIN(Redcraft) diff --git a/Redcraft.Utility/Source/Public/TypeTraits/Swappable.h b/Redcraft.Utility/Source/Public/TypeTraits/Swappable.h index 60a3b74..8ef79e9 100644 --- a/Redcraft.Utility/Source/Public/TypeTraits/Swappable.h +++ b/Redcraft.Utility/Source/Public/TypeTraits/Swappable.h @@ -1,6 +1,7 @@ #pragma once #include "CoreTypes.h" +#include "Templates/Utility.h" #include "TypeTraits/HelperClasses.h" NAMESPACE_REDCRAFT_BEGIN @@ -9,10 +10,6 @@ NAMESPACE_MODULE_BEGIN(Utility) NAMESPACE_PRIVATE_BEGIN -// This is a copy of a declaration to prevent circular references, originally defined in Templates/Utility.h -template requires TIsMoveConstructible::Value&& TIsMoveAssignable::Value -constexpr void Swap(T& A, T& B); - template concept CSwappableWith = requires(T&& A, U&& B)