Skip to content

Commit e69008d

Browse files
committed
fix invalid test cases created under the assumption that iterators for std::array are pointers
1 parent 860f9e5 commit e69008d

40 files changed

+232
-200
lines changed

libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ constexpr bool test() {
128128
{ // check that an iterator is returned with a borrowing range
129129
std::array in{1, 2, 3, 4};
130130
std::array<int, 4> out;
131-
std::same_as<std::ranges::in_out_result<int*, int*>> auto ret = std::ranges::copy(std::views::all(in), out.data());
132-
assert(ret.in == in.data() + 4);
131+
std::same_as<std::ranges::in_out_result<std::array<int, 4>::iterator, int*>> auto ret = std::ranges::copy(std::views::all(in), out.data());
132+
assert(ret.in == in.end());
133133
assert(ret.out == out.data() + 4);
134134
assert(in == out);
135135
}

libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_backward.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ constexpr bool test() {
247247
{ // check that an iterator is returned with a borrowing range
248248
std::array in {1, 2, 3, 4};
249249
std::array<int, 4> out;
250-
std::same_as<std::ranges::in_out_result<int*, int*>> auto ret =
250+
std::same_as<std::ranges::in_out_result<std::array<int, 4>::iterator, int*>> auto ret =
251251
std::ranges::copy_backward(std::views::all(in), out.data() + out.size());
252-
assert(ret.in == in.data() + in.size());
252+
assert(ret.in == in.end());
253253
assert(ret.out == out.data());
254254
assert(in == out);
255255
}

libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_n.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ constexpr void test_iterators() {
5353
{ // check that an empty range works
5454
std::array<int, 0> in;
5555
std::array<int, 0> out;
56-
auto ret = std::ranges::copy_n(In(in.data()), in.size(), Out(out.begin()));
56+
auto ret = std::ranges::copy_n(In(in.data()), in.size(), Out(out.data()));
5757
assert(base(ret.in) == in.data());
5858
assert(base(ret.out) == out.data());
5959
}
@@ -103,7 +103,7 @@ constexpr bool test() {
103103
};
104104
std::array<CopyOnce, 4> in {};
105105
std::array<CopyOnce, 4> out {};
106-
auto ret = std::ranges::copy_n(in.data(), in.size(), out.begin());
106+
auto ret = std::ranges::copy_n(in.begin(), in.size(), out.begin());
107107
assert(ret.in == in.end());
108108
assert(ret.out == out.end());
109109
assert(std::all_of(out.begin(), out.end(), [](const auto& e) { return e.copied; }));

libcxx/test/std/algorithms/alg.modifying.operations/alg.fill/ranges.fill.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ constexpr bool test() {
120120
{
121121
std::array<std::string, 10> a;
122122
auto ret = std::ranges::fill(a.begin(), a.end(), "long long string so no SSO");
123-
assert(ret == a.data() + a.size());
123+
assert(ret == a.begin() + a.size());
124124
assert(std::all_of(a.begin(), a.end(), [](auto& s) { return s == "long long string so no SSO"; }));
125125
}
126126
{
127127
std::array<std::string, 10> a;
128128
auto ret = std::ranges::fill(a, "long long string so no SSO");
129-
assert(ret == a.data() + a.size());
129+
assert(ret == a.begin() + a.size());
130130
assert(std::all_of(a.begin(), a.end(), [](auto& s) { return s == "long long string so no SSO"; }));
131131
}
132132
}

libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@ constexpr bool test() {
275275
{ // check that an iterator is returned with a borrowing range
276276
std::array in {1, 2, 3, 4};
277277
std::array<int, 4> out;
278-
std::same_as<std::ranges::in_out_result<int*, int*>> decltype(auto) ret =
278+
std::same_as<std::ranges::in_out_result<std::array<int, 4>::iterator, int*>> decltype(auto) ret =
279279
std::ranges::move(std::views::all(in), out.data());
280-
assert(ret.in == in.data() + 4);
280+
assert(ret.in == in.end());
281281
assert(ret.out == out.data() + 4);
282282
assert(in == out);
283283
}

libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move_backward.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,9 @@ constexpr bool test() {
261261
{ // check that an iterator is returned with a borrowing range
262262
std::array in {1, 2, 3, 4};
263263
std::array<int, 4> out;
264-
std::same_as<std::ranges::in_out_result<int*, int*>> auto ret =
264+
std::same_as<std::ranges::in_out_result<std::array<int, 4>::iterator, int*>> auto ret =
265265
std::ranges::move_backward(std::views::all(in), out.data() + out.size());
266-
assert(ret.in == in.data() + in.size());
266+
assert(ret.in == in.end());
267267
assert(ret.out == out.data());
268268
assert(in == out);
269269
}

libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_copy.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ constexpr void test_one(std::array<int, N1> input, Pred pred, std::array<int, N2
132132
std::array<int, N3> out2;
133133

134134
std::same_as<ResultT> decltype(auto) result = std::ranges::partition_copy(
135-
Iter(begin), Sent(Iter(end)), OutIter1(out1.begin()), OutIter2(out2.begin()), pred);
135+
Iter(begin), Sent(Iter(end)), OutIter1(out1.data()), OutIter2(out2.data()), pred);
136136

137137
assert(base(result.in) == input.data() + input.size());
138138
assert(base(result.out1) == out1.data() + expected_true.size());
@@ -148,7 +148,7 @@ constexpr void test_one(std::array<int, N1> input, Pred pred, std::array<int, N2
148148
std::array<int, N3> out2;
149149

150150
std::same_as<ResultT> decltype(auto) result = std::ranges::partition_copy(
151-
range, OutIter1(out1.begin()), OutIter2(out2.begin()), pred);
151+
range, OutIter1(out1.data()), OutIter2(out2.data()), pred);
152152

153153
assert(base(result.in) == input.data() + input.size());
154154
assert(base(result.out1) == out1.data() + expected_true.size());

libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/ranges_sample.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void test_one(std::array<int, N> in, std::size_t n, Gen gen) {
164164
auto begin = Iter(in.data());
165165
auto end = Sent(Iter(in.data() + in.size()));
166166
std::array<int, N> output;
167-
auto out = Out(output.begin());
167+
auto out = Out(output.data());
168168

169169
std::same_as<Out> decltype(auto) result = std::ranges::sample(
170170
std::move(begin), std::move(end), std::move(out), n, gen);
@@ -177,7 +177,7 @@ void test_one(std::array<int, N> in, std::size_t n, Gen gen) {
177177
auto begin = Iter(in.data());
178178
auto end = Sent(Iter(in.data() + in.size()));
179179
std::array<int, N> output;
180-
auto out = Out(output.begin());
180+
auto out = Out(output.data());
181181

182182
std::same_as<Out> decltype(auto) result = std::ranges::sample(std::ranges::subrange(
183183
std::move(begin), std::move(end)), std::move(out), n, gen);

libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges.remove.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ constexpr void test(Data<N, M> d) {
6565

6666
assert(base(ret.begin()) == input.data() + M);
6767
assert(base(ret.end()) == input.data() + N);
68-
assert(std::ranges::equal(input.begin(), base(ret.begin()), d.expected.begin(), d.expected.end()));
68+
assert(std::ranges::equal(input.data(), base(ret.begin()), d.expected.begin(), d.expected.end()));
6969
}
7070

7171
{ // range overload
@@ -76,7 +76,7 @@ constexpr void test(Data<N, M> d) {
7676

7777
assert(base(ret.begin()) == input.data() + M);
7878
assert(base(ret.end()) == input.data() + N);
79-
assert(std::ranges::equal(base(input.begin()), base(ret.begin()), d.expected.begin(), d.expected.end()));
79+
assert(std::ranges::equal(input.data(), base(ret.begin()), d.expected.begin(), d.expected.end()));
8080
}
8181
}
8282

libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges.remove_if.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ constexpr void test(Data<N, M> d) {
8585

8686
assert(base(ret.begin()) == input.data() + M);
8787
assert(base(ret.end()) == input.data() + N);
88-
assert(std::ranges::equal(base(input.begin()), base(ret.begin()), d.expected.begin(), d.expected.end()));
88+
assert(std::ranges::equal(input.data(), base(ret.begin()), d.expected.begin(), d.expected.end()));
8989
}
9090
}
9191

libcxx/test/std/algorithms/alg.modifying.operations/alg.swap/ranges.swap_ranges.pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ constexpr void test_range() {
6565
std::array r2 = {4, 5, 6};
6666

6767

68-
std::same_as<std::ranges::in_in_result<int*, int*>> auto r = std::ranges::swap_ranges(r1, r2);
68+
std::same_as<std::ranges::in_in_result<std::array<int, 3>::iterator, std::array<int, 3>::iterator>> auto r = std::ranges::swap_ranges(r1, r2);
6969
assert(r.in1 == r1.end());
7070
assert(r.in2 == r2.end());
7171

@@ -146,15 +146,15 @@ constexpr void test_iterators() {
146146

147147
constexpr void test_rval_range() {
148148
{
149-
using Expected = std::ranges::swap_ranges_result<int*, std::ranges::dangling>;
149+
using Expected = std::ranges::swap_ranges_result<std::array<int, 3>::iterator, std::ranges::dangling>;
150150
std::array<int, 3> r = {1, 2, 3};
151151
std::same_as<Expected> auto a = std::ranges::swap_ranges(r, std::array{4, 5, 6});
152152
assert((r == std::array{4, 5, 6}));
153153
assert(a.in1 == r.begin() + 3);
154154
}
155155
{
156156
std::array<int, 3> r = {1, 2, 3};
157-
using Expected = std::ranges::swap_ranges_result<std::ranges::dangling, int*>;
157+
using Expected = std::ranges::swap_ranges_result<std::ranges::dangling, std::array<int, 3>::iterator>;
158158
std::same_as<Expected> auto b = std::ranges::swap_ranges(std::array{4, 5, 6}, r);
159159
assert((r == std::array{4, 5, 6}));
160160
assert(b.in2 == r.begin() + 3);

libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/ranges_unique_copy.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ constexpr void testUniqueCopyImpl(std::array<int, N1> in, std::array<int, N2> ex
186186
{
187187
std::array<int, N2> out;
188188
std::same_as<std::ranges::unique_copy_result<InIter, OutIter>> decltype(auto) result =
189-
std::ranges::unique_copy(InIter{in.data()}, Sent{InIter{in.data() + in.size()}}, OutIter{out.begin()});
189+
std::ranges::unique_copy(InIter{in.data()}, Sent{InIter{in.data() + in.size()}}, OutIter{out.data()});
190190
assert(std::ranges::equal(out, expected));
191191
assert(base(result.in) == in.data() + in.size());
192192
assert(base(result.out) == out.data() + out.size());
@@ -197,7 +197,7 @@ constexpr void testUniqueCopyImpl(std::array<int, N1> in, std::array<int, N2> ex
197197
std::array<int, N2> out;
198198
std::ranges::subrange r{InIter{in.data()}, Sent{InIter{in.data() + in.size()}}};
199199
std::same_as<std::ranges::unique_copy_result<InIter, OutIter>> decltype(auto) result =
200-
std::ranges::unique_copy(r, OutIter{out.begin()});
200+
std::ranges::unique_copy(r, OutIter{out.data()});
201201
assert(std::ranges::equal(out, expected));
202202
assert(base(result.in) == in.data() + in.size());
203203
assert(base(result.out) == out.data() + out.size());

libcxx/test/std/algorithms/alg.nonmodifying/alg.all_of/ranges.all_of.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ constexpr void test_iterators() {
9393
auto pred = [&](int) { ++predicateCount; return true; };
9494
auto proj = [&](int i) { ++projectionCount; return i; };
9595
std::array a = {9, 7, 5, 3};
96-
assert(std::ranges::all_of(It(a.begin()), Sent(It(a.end())), pred, proj));
96+
assert(std::ranges::all_of(It(a.data()), Sent(It(a.data() + a.size())), pred, proj));
9797
assert(predicateCount == 4);
9898
assert(projectionCount == 4);
9999
}

libcxx/test/std/algorithms/alg.nonmodifying/alg.any_of/ranges.any_of.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ constexpr void test_iterators() {
9393
auto pred = [&](int) { ++predicateCount; return false; };
9494
auto proj = [&](int i) { ++projectionCount; return i; };
9595
std::array a = {9, 7, 5, 3};
96-
assert(!std::ranges::any_of(It(a.begin()), Sent(It(a.end())), pred, proj));
96+
assert(!std::ranges::any_of(It(a.data()), Sent(It(a.data() + a.size())), pred, proj));
9797
assert(predicateCount == 4);
9898
assert(projectionCount == 4);
9999
}

libcxx/test/std/algorithms/alg.nonmodifying/alg.none_of/ranges.none_of.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ constexpr void test_iterators() {
9393
auto pred = [&](int) { ++predicateCount; return false; };
9494
auto proj = [&](int i) { ++projectionCount; return i; };
9595
std::array a = {9, 7, 5, 3};
96-
assert(std::ranges::none_of(It(a.begin()), Sent(It(a.end())), pred, proj));
96+
assert(std::ranges::none_of(It(a.data()), Sent(It(a.data() + a.size())), pred, proj));
9797
assert(predicateCount == 4);
9898
assert(projectionCount == 4);
9999
}

libcxx/test/std/algorithms/alg.nonmodifying/mismatch/ranges_mismatch.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ constexpr bool test() {
105105
{ // test with a range
106106
std::array<int, 5> a = {1, 2, 3, 4, 5};
107107
std::array<int, 5> b = {1, 2, 3, 5, 4};
108-
using Expected = std::ranges::mismatch_result<int*, int*>;
108+
using Expected = std::ranges::mismatch_result<std::array<int, 5>::iterator, std::array<int, 5>::iterator>;
109109
std::same_as<Expected> auto ret = std::ranges::mismatch(a, b);
110110
assert(ret.in1 == a.begin() + 3);
111111
assert(ret.in2 == b.begin() + 3);

libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/ranges_make_heap.pass.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ static_assert(!HasMakeHeapR<UncheckedRange<const int*>>); // Doesn't satisfy `so
6060

6161
template <std::size_t N, class T, class Iter>
6262
constexpr void verify_heap(const std::array<T, N>& heapified, Iter last, std::array<T, N> expected) {
63+
assert(heapified == expected);
64+
assert(last == heapified.end());
65+
assert(std::is_heap(heapified.begin(), heapified.end()));
66+
}
67+
68+
template <std::size_t N, class T, class Iter>
69+
constexpr void verify_heap_iterator(const std::array<T, N>& heapified, Iter last, std::array<T, N> expected) {
6370
assert(heapified == expected);
6471
assert(base(last) == heapified.data() + heapified.size());
6572
assert(std::is_heap(heapified.begin(), heapified.end()));
@@ -73,7 +80,7 @@ constexpr void test_one(const std::array<int, N> input, std::array<int, N> expec
7380
auto e = Sent(Iter(heapified.data() + heapified.size()));
7481

7582
std::same_as<Iter> decltype(auto) last = std::ranges::make_heap(b, e);
76-
verify_heap(heapified, last, expected);
83+
verify_heap_iterator(heapified, last, expected);
7784
}
7885

7986
{ // (range) overload.
@@ -83,7 +90,7 @@ constexpr void test_one(const std::array<int, N> input, std::array<int, N> expec
8390
auto range = std::ranges::subrange(b, e);
8491

8592
std::same_as<Iter> decltype(auto) last = std::ranges::make_heap(range);
86-
verify_heap(heapified, last, expected);
93+
verify_heap_iterator(heapified, last, expected);
8794
}
8895
}
8996

libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/ranges_pop_heap.pass.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ static_assert(!HasPopHeapR<UncheckedRange<const int*>>); // Doesn't satisfy `sor
6060

6161
template <std::size_t N, class T, class Iter>
6262
constexpr void verify_heap(const std::array<T, N>& heapified, Iter last, std::array<T, N> expected) {
63+
assert(heapified == expected);
64+
assert(last == heapified.end());
65+
assert(std::is_heap(heapified.begin(), heapified.end() - 1));
66+
assert(*std::max_element(heapified.begin(), heapified.end()) == heapified.back());
67+
}
68+
69+
template <std::size_t N, class T, class Iter>
70+
constexpr void verify_heap_iterator(const std::array<T, N>& heapified, Iter last, std::array<T, N> expected) {
6371
assert(heapified == expected);
6472
assert(base(last) == heapified.data() + heapified.size());
6573
assert(std::is_heap(heapified.begin(), heapified.end() - 1));
@@ -77,7 +85,7 @@ constexpr void test_one(const std::array<int, N> input, std::array<int, N> expec
7785
auto e = Sent(Iter(heapified.data() + heapified.size()));
7886

7987
std::same_as<Iter> decltype(auto) last = std::ranges::pop_heap(b, e);
80-
verify_heap(heapified, last, expected);
88+
verify_heap_iterator(heapified, last, expected);
8189
}
8290

8391
{ // (range) overload.
@@ -87,7 +95,7 @@ constexpr void test_one(const std::array<int, N> input, std::array<int, N> expec
8795
auto range = std::ranges::subrange(b, e);
8896

8997
std::same_as<Iter> decltype(auto) last = std::ranges::pop_heap(range);
90-
verify_heap(heapified, last, expected);
98+
verify_heap_iterator(heapified, last, expected);
9199
}
92100
}
93101

@@ -130,15 +138,15 @@ constexpr bool test() {
130138
auto in = input;
131139
auto last = std::ranges::pop_heap(in.begin(), in.end(), comp);
132140
assert(in == expected);
133-
assert(last == in.data() + in.size());
141+
assert(last == in.end());
134142
assert(std::is_heap(in.begin(), in.end() - 1, comp));
135143
}
136144

137145
{
138146
auto in = input;
139147
auto last = std::ranges::pop_heap(in, comp);
140148
assert(in == expected);
141-
assert(last == in.data() + in.size());
149+
assert(last == in.end());
142150
assert(std::is_heap(in.begin(), in.end() - 1, comp));
143151
}
144152
}

libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/ranges_push_heap.pass.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ static_assert(!HasPushHeapR<UncheckedRange<const int*>>); // Doesn't satisfy `so
6060

6161
template <std::size_t N, class T, class Iter>
6262
constexpr void verify_heap(const std::array<T, N>& heapified, Iter last, std::array<T, N> expected) {
63+
assert(heapified == expected);
64+
assert(last == heapified.end());
65+
assert(std::is_heap(heapified.begin(), heapified.end()));
66+
}
67+
68+
template <std::size_t N, class T, class Iter>
69+
constexpr void verify_heap_iterator(const std::array<T, N>& heapified, Iter last, std::array<T, N> expected) {
6370
assert(heapified == expected);
6471
assert(base(last) == heapified.data() + heapified.size());
6572
assert(std::is_heap(heapified.begin(), heapified.end()));
@@ -77,7 +84,7 @@ constexpr void test_one(const std::array<int, N> input, std::array<int, N> expec
7784
auto e = Sent(Iter(heapified.data() + heapified.size()));
7885

7986
std::same_as<Iter> decltype(auto) last = std::ranges::push_heap(b, e);
80-
verify_heap(heapified, last, expected);
87+
verify_heap_iterator(heapified, last, expected);
8188
}
8289

8390
{ // (range) overload.
@@ -87,7 +94,7 @@ constexpr void test_one(const std::array<int, N> input, std::array<int, N> expec
8794
auto range = std::ranges::subrange(b, e);
8895

8996
std::same_as<Iter> decltype(auto) last = std::ranges::push_heap(range);
90-
verify_heap(heapified, last, expected);
97+
verify_heap_iterator(heapified, last, expected);
9198
}
9299
}
93100

libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/ranges_sort_heap.pass.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ static_assert(!HasSortHeapR<UncheckedRange<const int*>>); // Doesn't satisfy `so
6161

6262
template <std::size_t N, class T, class Iter>
6363
constexpr void verify_sorted(const std::array<T, N>& sorted, Iter last, std::array<T, N> expected) {
64+
assert(sorted == expected);
65+
assert(last == sorted.end());
66+
assert(std::is_sorted(sorted.begin(), sorted.end()));
67+
}
68+
69+
template <std::size_t N, class T, class Iter>
70+
constexpr void verify_sorted_iterator(const std::array<T, N>& sorted, Iter last, std::array<T, N> expected) {
6471
assert(sorted == expected);
6572
assert(base(last) == sorted.data() + sorted.size());
6673
assert(std::is_sorted(sorted.begin(), sorted.end()));
@@ -76,7 +83,7 @@ constexpr void test_one(const std::array<int, N> input, std::array<int, N> expec
7683
auto e = Sent(Iter(sorted.data() + sorted.size()));
7784

7885
std::same_as<Iter> decltype(auto) last = std::ranges::sort_heap(b, e);
79-
verify_sorted(sorted, last, expected);
86+
verify_sorted_iterator(sorted, last, expected);
8087
}
8188

8289
{ // (range) overload.
@@ -86,7 +93,7 @@ constexpr void test_one(const std::array<int, N> input, std::array<int, N> expec
8693
auto range = std::ranges::subrange(b, e);
8794

8895
std::same_as<Iter> decltype(auto) last = std::ranges::sort_heap(range);
89-
verify_sorted(sorted, last, expected);
96+
verify_sorted_iterator(sorted, last, expected);
9097
}
9198
}
9299

@@ -131,14 +138,14 @@ constexpr bool test() {
131138
auto in = input;
132139
auto last = std::ranges::sort_heap(in.begin(), in.end(), comp);
133140
assert(in == expected);
134-
assert(last == in.data() + in.size());
141+
assert(last == in.end());
135142
}
136143

137144
{
138145
auto in = input;
139146
auto last = std::ranges::sort_heap(in, comp);
140147
assert(in == expected);
141-
assert(last == in.data() + in.size());
148+
assert(last == in.end());
142149
}
143150
}
144151

0 commit comments

Comments
 (0)