Skip to content

Commit f7af33a

Browse files
committed
[libc++] P2944R3: Constrained comparisions - tuple
Implements P2944R3 partially, which adds constrained comparisons `std::tuple`. The missing overloads introduced in P2165R4 are not implemented. Relates to #136765 # References [tuple.rel](https://eel.is/c++draft/tuple.rel)
1 parent 885cfc2 commit f7af33a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

libcxx/include/tuple

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,15 +1155,13 @@ struct __tuple_equal<0> {
11551155

11561156
template <class... _Tp, class... _Up>
11571157
# if _LIBCPP_STD_VER >= 26
1158-
requires(requires(const _Tp& __t, const _Up& __u) {
1159-
{ __t == __u } -> __boolean_testable;
1160-
} && ...) && (sizeof...(_Tp) == sizeof...(_Up))
1158+
requires(__all<requires(const _Tp& __t, const _Up& __u) {
1159+
{ __t == __u } -> __boolean_testable;
1160+
}...>::value && (sizeof...(_Tp) == sizeof...(_Up)))
11611161
# endif
11621162
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
11631163
operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) {
1164-
# if _LIBCPP_STD_VER < 26
11651164
static_assert(sizeof...(_Tp) == sizeof...(_Up), "Can't compare tuples of different sizes");
1166-
# endif
11671165
return __tuple_equal<sizeof...(_Tp)>()(__x, __y);
11681166
}
11691167

0 commit comments

Comments
 (0)