Skip to content

Commit

Permalink
Container spaceship changes, squashed.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahanamuk authored and StephanTLavavej committed Jul 15, 2020
1 parent 8fcc25f commit 81aff9b
Show file tree
Hide file tree
Showing 16 changed files with 380 additions and 0 deletions.
14 changes: 14 additions & 0 deletions stl/inc/array
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,10 @@ public:
return _Elems;
}

// friend constexpr bool operator==(const array&, const array&) = default;
// friend constexpr _Synth_three_way_result<value_type> operator<=>(const array&, const array&);
// friend constexpr bool operator<=>(const array&, const array&);

[[noreturn]] void _Xran() const {
_Xout_of_range("invalid array<T, N> subscript");
}
Expand Down Expand Up @@ -778,6 +782,7 @@ _NODISCARD _CONSTEXPR20 bool operator==(const array<_Ty, _Size>& _Left, const ar
return _STD equal(_Left.begin(), _Left.end(), _Right.begin());
}

#if !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L
template <class _Ty, size_t _Size>
_NODISCARD _CONSTEXPR20 bool operator!=(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
return !(_Left == _Right);
Expand All @@ -802,6 +807,15 @@ template <class _Ty, size_t _Size>
_NODISCARD _CONSTEXPR20 bool operator>=(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
return !(_Left < _Right);
}
#endif // !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L

#if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)
template <class _Ty, size_t _Size>
_NODISCARD _CONSTEXPR20 _Synth_three_way_result<_Ty> operator<=>(
const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
return _STD lexicographical_compare_three_way(_Left.begin(), _Left.end(), _Right.begin(), _Right.end());
}
#endif // defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)

#if _HAS_CXX20
// FUNCTION TEMPLATE to_array
Expand Down
10 changes: 10 additions & 0 deletions stl/inc/deque
Original file line number Diff line number Diff line change
Expand Up @@ -1581,6 +1581,7 @@ _NODISCARD bool operator==(const deque<_Ty, _Alloc>& _Left, const deque<_Ty, _Al
&& _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end(), _Right._Unchecked_begin());
}

#if !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L
template <class _Ty, class _Alloc>
_NODISCARD bool operator!=(const deque<_Ty, _Alloc>& _Left, const deque<_Ty, _Alloc>& _Right) {
return !(_Left == _Right);
Expand All @@ -1606,6 +1607,15 @@ template <class _Ty, class _Alloc>
_NODISCARD bool operator>=(const deque<_Ty, _Alloc>& _Left, const deque<_Ty, _Alloc>& _Right) {
return !(_Left < _Right);
}
#endif // !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L

#if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)
template <class _Ty, class _Alloc>
_NODISCARD _Synth_three_way_result<_Ty> operator<=>(const deque<_Ty, _Alloc>& _Left, const deque<_Ty, _Alloc>& _Right) {
return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end(),
_Right._Unchecked_begin(), _Right._Unchecked_end(), _Synth_three_way{});
}
#endif // defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)

#if _HAS_CXX20
template <class _Ty, class _Alloc, class _Uty>
Expand Down
11 changes: 11 additions & 0 deletions stl/inc/forward_list
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,7 @@ _NODISCARD bool operator==(const forward_list<_Ty, _Alloc>& _Left, const forward
return _STD equal(_Left.begin(), _Left.end(), _Right.begin(), _Right.end());
}

#if !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L
template <class _Ty, class _Alloc>
_NODISCARD bool operator!=(const forward_list<_Ty, _Alloc>& _Left, const forward_list<_Ty, _Alloc>& _Right) {
return !(_Left == _Right);
Expand All @@ -1545,6 +1546,16 @@ template <class _Ty, class _Alloc>
_NODISCARD bool operator>=(const forward_list<_Ty, _Alloc>& _Left, const forward_list<_Ty, _Alloc>& _Right) {
return !(_Left < _Right);
}
#endif // !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L

#if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)
template <class _Ty, class _Alloc>
_NODISCARD _Synth_three_way_result<_Ty> operator<=>(
const forward_list<_Ty, _Alloc>& _Left, const forward_list<_Ty, _Alloc>& _Right) {
return _STD lexicographical_compare_three_way(
_Left.begin(), _Left.end(), _Right.begin(), _Right.end(), _Synth_three_way{});
}
#endif // defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)

#if _HAS_CXX20
template <class _Ty, class _Alloc, class _Uty>
Expand Down
4 changes: 4 additions & 0 deletions stl/inc/iterator
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,13 @@ _NODISCARD bool operator==(const istream_iterator<_Ty, _Elem, _Traits, _Diff>& _
return _Left._Equal(_Right);
}

#if !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L
template <class _Ty, class _Elem, class _Traits, class _Diff>
_NODISCARD bool operator!=(const istream_iterator<_Ty, _Elem, _Traits, _Diff>& _Left,
const istream_iterator<_Ty, _Elem, _Traits, _Diff>& _Right) {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L

// CLASS TEMPLATE ostream_iterator
template <class _Ty, class _Elem = char, class _Traits = char_traits<_Elem>>
Expand Down Expand Up @@ -458,11 +460,13 @@ _NODISCARD bool operator==(
return _Left.equal(_Right);
}

#if !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L
template <class _Elem, class _Traits>
_NODISCARD bool operator!=(
const istreambuf_iterator<_Elem, _Traits>& _Left, const istreambuf_iterator<_Elem, _Traits>& _Right) {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L

// CLASS TEMPLATE ostreambuf_iterator
template <class _Elem, class _Traits>
Expand Down
10 changes: 10 additions & 0 deletions stl/inc/list
Original file line number Diff line number Diff line change
Expand Up @@ -1810,6 +1810,7 @@ _NODISCARD bool operator==(const list<_Ty, _Alloc>& _Left, const list<_Ty, _Allo
return _Left.size() == _Right.size() && _STD equal(_Left.begin(), _Left.end(), _Right.begin());
}

#if !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L
template <class _Ty, class _Alloc>
_NODISCARD bool operator!=(const list<_Ty, _Alloc>& _Left, const list<_Ty, _Alloc>& _Right) {
return !(_Left == _Right);
Expand All @@ -1834,6 +1835,15 @@ template <class _Ty, class _Alloc>
_NODISCARD bool operator>=(const list<_Ty, _Alloc>& _Left, const list<_Ty, _Alloc>& _Right) {
return !(_Left < _Right);
}
#endif // !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L

#if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)
template <class _Ty, class _Alloc>
_NODISCARD _Synth_three_way_result<_Ty> operator<=>(const list<_Ty, _Alloc>& _Left, const list<_Ty, _Alloc>& _Right) {
return _STD lexicographical_compare_three_way(
_Left.begin(), _Left.end(), _Right.begin(), _Right.end(), _Synth_three_way{});
}
#endif // defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)

#if _HAS_CXX20
template <class _Ty, class _Alloc, class _Uty>
Expand Down
22 changes: 22 additions & 0 deletions stl/inc/map
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ _NODISCARD bool operator==(const map<_Kty, _Ty, _Pr, _Alloc>& _Left, const map<_
&& _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(), _Right._Unchecked_begin());
}

#if !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L
template <class _Kty, class _Ty, class _Pr, class _Alloc>
_NODISCARD bool operator!=(const map<_Kty, _Ty, _Pr, _Alloc>& _Left, const map<_Kty, _Ty, _Pr, _Alloc>& _Right) {
return !(_Left == _Right);
Expand All @@ -394,6 +395,16 @@ template <class _Kty, class _Ty, class _Pr, class _Alloc>
_NODISCARD bool operator>=(const map<_Kty, _Ty, _Pr, _Alloc>& _Left, const map<_Kty, _Ty, _Pr, _Alloc>& _Right) {
return !(_Left < _Right);
}
#endif // !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L

#if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)
template <class _Kty, class _Ty, class _Pr, class _Alloc>
_NODISCARD _Synth_three_way_result<pair<const _Kty, _Ty>> operator<=>(
const map<_Kty, _Ty, _Pr, _Alloc>& _Left, const map<_Kty, _Ty, _Pr, _Alloc>& _Right) {
return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(),
_Right._Unchecked_begin(), _Right._Unchecked_end_iter(), _Synth_three_way{});
}
#endif // defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)

template <class _Kty, class _Ty, class _Pr, class _Alloc>
void swap(map<_Kty, _Ty, _Pr, _Alloc>& _Left, map<_Kty, _Ty, _Pr, _Alloc>& _Right) noexcept(
Expand Down Expand Up @@ -557,6 +568,7 @@ _NODISCARD bool operator==(
&& _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(), _Right._Unchecked_begin());
}

#if !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L
template <class _Kty, class _Ty, class _Pr, class _Alloc>
_NODISCARD bool operator!=(
const multimap<_Kty, _Ty, _Pr, _Alloc>& _Left, const multimap<_Kty, _Ty, _Pr, _Alloc>& _Right) {
Expand Down Expand Up @@ -587,6 +599,16 @@ _NODISCARD bool operator>=(
const multimap<_Kty, _Ty, _Pr, _Alloc>& _Left, const multimap<_Kty, _Ty, _Pr, _Alloc>& _Right) {
return !(_Left < _Right);
}
#endif // !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L

#if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)
template <class _Kty, class _Ty, class _Pr, class _Alloc>
_NODISCARD _Synth_three_way_result<pair<const _Kty, _Ty>> operator<=>(
const multimap<_Kty, _Ty, _Pr, _Alloc>& _Left, const multimap<_Kty, _Ty, _Pr, _Alloc>& _Right) {
return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(),
_Right._Unchecked_begin(), _Right._Unchecked_end_iter(), _Synth_three_way{});
}
#endif // defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)

template <class _Kty, class _Ty, class _Pr, class _Alloc>
void swap(multimap<_Kty, _Ty, _Pr, _Alloc>& _Left, multimap<_Kty, _Ty, _Pr, _Alloc>& _Right) noexcept(
Expand Down
9 changes: 9 additions & 0 deletions stl/inc/queue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ _NODISCARD bool operator>=(const queue<_Ty, _Container>& _Left, const queue<_Ty,
return _Left.c >= _Right.c;
}

#if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)
template <class _Ty, three_way_comparable _Container>
_NODISCARD compare_three_way_result_t<_Container> operator<=>(
const queue<_Ty, _Container>& _Left, const queue<_Ty, _Container>& _Right) {
return _Left.c <=> _Right.c;
}
#endif // defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)

template <class _Ty, class _Container>
class queue {
public:
Expand Down Expand Up @@ -148,6 +156,7 @@ public:
friend bool operator> <>(const queue&, const queue&);
friend bool operator<= <>(const queue&, const queue&);
friend bool operator>= <>(const queue&, const queue&);
friend compare_three_way_result_t<_Container> operator<=> <>(const queue&, const queue&);
// clang-format on

protected:
Expand Down
22 changes: 22 additions & 0 deletions stl/inc/set
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ _NODISCARD bool operator==(const set<_Kty, _Pr, _Alloc>& _Left, const set<_Kty,
&& _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(), _Right._Unchecked_begin());
}

#if !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L
template <class _Kty, class _Pr, class _Alloc>
_NODISCARD bool operator!=(const set<_Kty, _Pr, _Alloc>& _Left, const set<_Kty, _Pr, _Alloc>& _Right) {
return !(_Left == _Right);
Expand All @@ -205,6 +206,16 @@ template <class _Kty, class _Pr, class _Alloc>
_NODISCARD bool operator>=(const set<_Kty, _Pr, _Alloc>& _Left, const set<_Kty, _Pr, _Alloc>& _Right) {
return !(_Left < _Right);
}
#endif // !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L

#if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)
template <class _Kty, class _Pr, class _Alloc>
_NODISCARD _Synth_three_way_result<_Kty> operator<=>(
const set<_Kty, _Pr, _Alloc>& _Left, const set<_Kty, _Pr, _Alloc>& _Right) {
return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(),
_Right._Unchecked_begin(), _Right._Unchecked_end_iter(), _Synth_three_way{});
}
#endif // defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)

template <class _Kty, class _Pr, class _Alloc>
void swap(set<_Kty, _Pr, _Alloc>& _Left, set<_Kty, _Pr, _Alloc>& _Right) noexcept(noexcept(_Left.swap(_Right))) {
Expand Down Expand Up @@ -352,6 +363,7 @@ _NODISCARD bool operator==(const multiset<_Kty, _Pr, _Alloc>& _Left, const multi
&& _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(), _Right._Unchecked_begin());
}

#if !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L
template <class _Kty, class _Pr, class _Alloc>
_NODISCARD bool operator!=(const multiset<_Kty, _Pr, _Alloc>& _Left, const multiset<_Kty, _Pr, _Alloc>& _Right) {
return !(_Left == _Right);
Expand All @@ -377,6 +389,16 @@ template <class _Kty, class _Pr, class _Alloc>
_NODISCARD bool operator>=(const multiset<_Kty, _Pr, _Alloc>& _Left, const multiset<_Kty, _Pr, _Alloc>& _Right) {
return !(_Left < _Right);
}
#endif // !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L

#if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)
template <class _Kty, class _Pr, class _Alloc>
_NODISCARD _Synth_three_way_result<_Kty> operator<=>(
const multiset<_Kty, _Pr, _Alloc>& _Left, const multiset<_Kty, _Pr, _Alloc>& _Right) {
return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(),
_Right._Unchecked_begin(), _Right._Unchecked_end_iter(), _Synth_three_way{});
}
#endif // defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)

template <class _Kty, class _Pr, class _Alloc>
void swap(multiset<_Kty, _Pr, _Alloc>& _Left, multiset<_Kty, _Pr, _Alloc>& _Right) noexcept(
Expand Down
9 changes: 9 additions & 0 deletions stl/inc/stack
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ _NODISCARD bool operator>=(const stack<_Ty, _Container>& _Left, const stack<_Ty,
return _Left.c >= _Right.c;
}

#if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)
template <class _Ty, three_way_comparable _Container>
_NODISCARD compare_three_way_result_t<_Container> operator<=>(
const stack<_Ty, _Container>& _Left, const stack<_Ty, _Container>& _Right) {
return _Left.c <=> _Right.c;
}
#endif // defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)

template <class _Ty, class _Container>
class stack {
public:
Expand Down Expand Up @@ -138,6 +146,7 @@ public:
friend bool operator> <>(const stack&, const stack&);
friend bool operator<= <>(const stack&, const stack&);
friend bool operator>= <>(const stack&, const stack&);
friend compare_three_way_result_t<_Container> operator<=> <>(const stack&, const stack&);
// clang-format on

protected:
Expand Down
4 changes: 4 additions & 0 deletions stl/inc/unordered_map
Original file line number Diff line number Diff line change
Expand Up @@ -468,11 +468,13 @@ _NODISCARD bool operator==(const unordered_map<_Kty, _Ty, _Hasher, _Keyeq, _Allo
return _Hash_equal(_Left, _Right);
}

#if !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L
template <class _Kty, class _Ty, class _Hasher, class _Keyeq, class _Alloc>
_NODISCARD bool operator!=(const unordered_map<_Kty, _Ty, _Hasher, _Keyeq, _Alloc>& _Left,
const unordered_map<_Kty, _Ty, _Hasher, _Keyeq, _Alloc>& _Right) {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L

// CLASS TEMPLATE unordered_multimap
template <class _Kty, class _Ty, class _Hasher = hash<_Kty>, class _Keyeq = equal_to<_Kty>,
Expand Down Expand Up @@ -758,11 +760,13 @@ _NODISCARD bool operator==(const unordered_multimap<_Kty, _Ty, _Hasher, _Keyeq,
return _Hash_equal(_Left, _Right);
}

#if !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L
template <class _Kty, class _Ty, class _Hasher, class _Keyeq, class _Alloc>
_NODISCARD bool operator!=(const unordered_multimap<_Kty, _Ty, _Hasher, _Keyeq, _Alloc>& _Left,
const unordered_multimap<_Kty, _Ty, _Hasher, _Keyeq, _Alloc>& _Right) {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L

#if _HAS_TR1_NAMESPACE
namespace _DEPRECATE_TR1_NAMESPACE tr1 {
Expand Down
4 changes: 4 additions & 0 deletions stl/inc/unordered_set
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,13 @@ _NODISCARD bool operator==(const unordered_set<_Kty, _Hasher, _Keyeq, _Alloc>& _
return _Hash_equal(_Left, _Right);
}

#if !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L
template <class _Kty, class _Hasher, class _Keyeq, class _Alloc>
_NODISCARD bool operator!=(const unordered_set<_Kty, _Hasher, _Keyeq, _Alloc>& _Left,
const unordered_set<_Kty, _Hasher, _Keyeq, _Alloc>& _Right) {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L

// CLASS TEMPLATE unordered_multiset
template <class _Kty, class _Hasher = hash<_Kty>, class _Keyeq = equal_to<_Kty>, class _Alloc = allocator<_Kty>>
Expand Down Expand Up @@ -584,11 +586,13 @@ _NODISCARD bool operator==(const unordered_multiset<_Kty, _Hasher, _Keyeq, _Allo
return _Hash_equal(_Left, _Right);
}

#if !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L
template <class _Kty, class _Hasher, class _Keyeq, class _Alloc>
_NODISCARD bool operator!=(const unordered_multiset<_Kty, _Hasher, _Keyeq, _Alloc>& _Left,
const unordered_multiset<_Kty, _Hasher, _Keyeq, _Alloc>& _Right) {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20 || __cpp_impl_three_way_comparison < 201902L

#if _HAS_TR1_NAMESPACE
namespace _DEPRECATE_TR1_NAMESPACE tr1 {
Expand Down
52 changes: 52 additions & 0 deletions stl/inc/utility
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,58 @@ _NODISCARD constexpr bool cmp_greater_equal(const _Ty1 _Left, const _Ty2 _Right)
return !_STD cmp_less(_Left, _Right);
}

#if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)
// STRUCT TEMPLATE _Synth_three_way
template <class _Ty = void>
struct _Synth_three_way {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _SECOND_ARGUMENT_TYPE_NAME;

constexpr auto operator()(const _Ty& _Left, const _Ty& _Right) const {
if constexpr (three_way_comparable_with<_Ty, _Ty>) {
return _Left <=> _Right;
} else {
if (_Left < _Right) {
return weak_ordering::less;
} else if (_Right < _Left) {
return weak_ordering::greater;
} else {
return weak_ordering::equivalent;
}
}
}
};

// STRUCT TEMPLATE SPECIALIZATION _Synth_three_way
template <>
struct _Synth_three_way<void> {
// clang-format off
template <class _Ty1, class _Ty2>
constexpr auto operator()(_Ty1& _Left, _Ty2& _Right) const requires requires {
{ _Left < _Right } ->_Boolean_testable;
{ _Right < _Left } ->_Boolean_testable;
}
// clang-format on
{
if constexpr (three_way_comparable_with<_Ty1, _Ty2>) {
return _Left <=> _Right;
} else {
if (_Left < _Right) {
return weak_ordering::less;
} else if (_Right < _Left) {
return weak_ordering::greater;
} else {
return weak_ordering::equivalent;
}
}
}
};

// ALIAS TEMPLATE _Synth_three_way_result
template <class _Ty1, class _Ty2 = _Ty1>
using _Synth_three_way_result = decltype(_Synth_three_way{}(_STD declval<_Ty1&>(), _STD declval<_Ty2&>()));
#endif // defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)

// FUNCTION TEMPLATE in_range
template <class _Ty>
_NODISCARD constexpr _Ty _Min_limit() noexcept { // same as (numeric_limits<_Ty>::min)(), less throughput cost
Expand Down
Loading

0 comments on commit 81aff9b

Please sign in to comment.