2022-02-04 07:47:57 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "CoreTypes.h"
|
|
|
|
#include "Concepts/Common.h"
|
2022-03-06 15:32:39 +00:00
|
|
|
#include "Templates/Utility.h"
|
2022-02-04 07:47:57 +00:00
|
|
|
#include "TypeTraits/TypeTraits.h"
|
|
|
|
|
|
|
|
NAMESPACE_REDCRAFT_BEGIN
|
|
|
|
NAMESPACE_MODULE_BEGIN(Redcraft)
|
|
|
|
NAMESPACE_MODULE_BEGIN(Utility)
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
concept CSwappable = requires(T& A, T& B) { Swap(A, B); };
|
|
|
|
|
|
|
|
template <typename T, typename U>
|
|
|
|
concept CSwappableWith = CCommonReferenceWith<T, U> &&
|
|
|
|
requires(T&& A, U&& B)
|
|
|
|
{
|
|
|
|
Swap(Forward<T>(A), Forward<T>(A));
|
|
|
|
Swap(Forward<U>(B), Forward<U>(B));
|
|
|
|
Swap(Forward<T>(A), Forward<U>(B));
|
|
|
|
Swap(Forward<U>(B), Forward<T>(A));
|
|
|
|
};
|
|
|
|
|
|
|
|
NAMESPACE_MODULE_END(Utility)
|
|
|
|
NAMESPACE_MODULE_END(Redcraft)
|
|
|
|
NAMESPACE_REDCRAFT_END
|