fix(templates): fix recursive #include due to native array swap function
This commit is contained in:
parent
6a37e91639
commit
f54386d102
@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreTypes.h"
|
#include "CoreTypes.h"
|
||||||
#include "TypeTraits/Common.h"
|
|
||||||
#include "TypeTraits/Miscellaneous.h"
|
#include "TypeTraits/Miscellaneous.h"
|
||||||
#include "TypeTraits/SupportedOperations.h"
|
#include "TypeTraits/SupportedOperations.h"
|
||||||
|
|
||||||
@ -74,11 +73,10 @@ FORCEINLINE constexpr void Swap(T& A, T& B)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Overloads the Swap algorithm for arrays. */
|
/** Overloads the Swap algorithm for arrays. */
|
||||||
template <typename T, typename U, size_t N> requires (CCommonReference<T, U>
|
template <typename T, size_t N> requires (requires(T& A, T& B) { Swap(A, B); })
|
||||||
&& requires(T& A, U& B) { Swap(A, A); Swap(B, B); Swap(A, B); Swap(B, A); })
|
FORCEINLINE constexpr void Swap(T(&A)[N], T(&B)[N])
|
||||||
FORCEINLINE constexpr void Swap(T(&A)[N], U(&B)[N])
|
|
||||||
{
|
{
|
||||||
for (size_t Index = 0; Index < N; ++Index)
|
for (size_t Index = 0; Index != N; ++Index)
|
||||||
{
|
{
|
||||||
Swap(A[Index], B[Index]);
|
Swap(A[Index], B[Index]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user