#pragma once #include "CoreTypes.h" #include "Concepts/Common.h" #include "TypeTraits/TypeTraits.h" #include "Concepts/BooleanTestable.h" NAMESPACE_REDCRAFT_BEGIN NAMESPACE_MODULE_BEGIN(Redcraft) NAMESPACE_MODULE_BEGIN(Utility) template concept CWeaklyEqualityComparableWith = requires(const TRemoveReference::Type & A, const TRemoveReference::Type & B) { { A == B } -> CBooleanTestable; { A != B } -> CBooleanTestable; { B == A } -> CBooleanTestable; { B != A } -> CBooleanTestable; }; template concept CEqualityComparable = CWeaklyEqualityComparableWith; template concept CEqualityComparableWith = CEqualityComparable && CEqualityComparable && CWeaklyEqualityComparableWith && CCommonReferenceWith::Type&, const typename TRemoveReference::Type&> && CEqualityComparable::Type&, const typename TRemoveReference::Type&>::Type>; template concept CPartiallyOrderedWith = requires(const TRemoveReference::Type& A, const TRemoveReference::Type& B) { { A < B } -> CBooleanTestable; { A > B } -> CBooleanTestable; { A <= B } -> CBooleanTestable; { A >= B } -> CBooleanTestable; { B < A } -> CBooleanTestable; { B > A } -> CBooleanTestable; { B <= A } -> CBooleanTestable; { B >= A } -> CBooleanTestable; }; template concept CTotallyOrdered = CEqualityComparable && CPartiallyOrderedWith; template concept CTotallyOrderedWith = CTotallyOrdered && CTotallyOrdered && CPartiallyOrderedWith && CEqualityComparableWith && CTotallyOrdered::Type&, const typename TRemoveReference::Type&>::Type>; NAMESPACE_MODULE_END(Utility) NAMESPACE_MODULE_END(Redcraft) NAMESPACE_REDCRAFT_END