Skip to content

Commit 95112df

Browse files
committed
fixup! [libc++][NFC] Centralize test for support of == and != in ranges
Addressing final feedback and consolidating one final spot.
1 parent 6440360 commit 95112df

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include "test_comparisons.h"
2323
#include "test_iterators.h"
24+
#include "test_range.h"
2425

2526
template <bool Const>
2627
using MaybeConstIterator = cpp20_input_iterator<std::conditional_t<Const, const int*, int*>>;
@@ -77,14 +78,6 @@ struct NonCrossConstComparableView : std::ranges::view_base {
7778
static_assert(std::ranges::range<NonCrossConstComparableView>);
7879
static_assert(std::ranges::range<const NonCrossConstComparableView>);
7980

80-
template <class T, class U>
81-
concept weakly_equality_comparable_with = requires(const T& t, const U& u) {
82-
t == u;
83-
t != u;
84-
u == t;
85-
u != t;
86-
};
87-
8881
constexpr bool test() {
8982
int buffer[8] = {1, 2, 3, 4, 5, 6, 7, 8};
9083
using CrossConstComparableTakeView = std::ranges::take_view<CrossConstComparableView>;

libcxx/test/support/test_range.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ concept CanBePiped = requires(View&& view, T&& t) {
9696
{ std::forward<View>(view) | std::forward<T>(t) };
9797
};
9898

99+
// See [concept.equalitycomparable]
99100
template <class T, class U>
100101
concept weakly_equality_comparable_with =
101102
requires(const std::remove_reference_t<T>& t, const std::remove_reference_t<U>& u) {

0 commit comments

Comments
 (0)