diff options
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__concepts/equality_comparable.h')
| -rw-r--r-- | contrib/llvm-project/libcxx/include/__concepts/equality_comparable.h | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/contrib/llvm-project/libcxx/include/__concepts/equality_comparable.h b/contrib/llvm-project/libcxx/include/__concepts/equality_comparable.h index b865141705f1..278fc7640928 100644 --- a/contrib/llvm-project/libcxx/include/__concepts/equality_comparable.h +++ b/contrib/llvm-project/libcxx/include/__concepts/equality_comparable.h @@ -21,33 +21,35 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#if _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER >= 20 // [concept.equalitycomparable] -template<class _Tp, class _Up> +template <class _Tp, class _Up> concept __weakly_equality_comparable_with = - requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) { - { __t == __u } -> __boolean_testable; - { __t != __u } -> __boolean_testable; - { __u == __t } -> __boolean_testable; - { __u != __t } -> __boolean_testable; - }; - -template<class _Tp> + requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) { + { __t == __u } -> __boolean_testable; + { __t != __u } -> __boolean_testable; + { __u == __t } -> __boolean_testable; + { __u != __t } -> __boolean_testable; + }; + +template <class _Tp> concept equality_comparable = __weakly_equality_comparable_with<_Tp, _Tp>; -template<class _Tp, class _Up> +// clang-format off +template <class _Tp, class _Up> concept equality_comparable_with = - equality_comparable<_Tp> && equality_comparable<_Up> && - common_reference_with<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>> && - equality_comparable< - common_reference_t< - __make_const_lvalue_ref<_Tp>, - __make_const_lvalue_ref<_Up>>> && - __weakly_equality_comparable_with<_Tp, _Up>; - -#endif // _LIBCPP_STD_VER > 17 + equality_comparable<_Tp> && equality_comparable<_Up> && + common_reference_with<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>> && + equality_comparable< + common_reference_t< + __make_const_lvalue_ref<_Tp>, + __make_const_lvalue_ref<_Up>>> && + __weakly_equality_comparable_with<_Tp, _Up>; +// clang-format on + +#endif // _LIBCPP_STD_VER >= 20 _LIBCPP_END_NAMESPACE_STD |
