refactor(typetraits): simplifies concept selection and removes the concept of bitwise operations

This commit is contained in:
2022-05-21 22:39:22 +08:00
parent ee46d84897
commit 97910be70c
14 changed files with 93 additions and 263 deletions

View File

@ -254,7 +254,7 @@ private:
template <typename T>
TOptional(T) -> TOptional<T>;
template <typename T, typename U> requires CWeaklyEqualityComparableWith<T, U>
template <typename T, typename U> requires CWeaklyEqualityComparable<T, U>
constexpr bool operator==(const TOptional<T>& LHS, const TOptional<U>& RHS)
{
if (LHS.IsValid() != RHS.IsValid()) return false;
@ -262,7 +262,7 @@ constexpr bool operator==(const TOptional<T>& LHS, const TOptional<U>& RHS)
return *LHS == *RHS;
}
template <typename T, typename U> requires CSynthThreeWayComparableWith<T, U>
template <typename T, typename U> requires CSynthThreeWayComparable<T, U>
constexpr partial_ordering operator<=>(const TOptional<T>& LHS, const TOptional<U>& RHS)
{
if (LHS.IsValid() != RHS.IsValid()) return partial_ordering::unordered;
@ -270,7 +270,7 @@ constexpr partial_ordering operator<=>(const TOptional<T>& LHS, const TOptional<
return SynthThreeWayCompare(*LHS, *RHS);
}
template <typename T, typename U> requires CWeaklyEqualityComparableWith<T, U>
template <typename T, typename U> requires CWeaklyEqualityComparable<T, U>
constexpr bool operator==(const TOptional<T>& LHS, const U& RHS)
{
return LHS.IsValid() ? *LHS == RHS : false;