[libcxx-commits] [libcxx] [libc++][test] Refactor tests for rotate and rotate_copy (PR #126458)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 19 10:14:30 PST 2025


================
@@ -101,41 +100,33 @@ constexpr void test_iterators() {
   test<Iter, OutIter, Sent, 7>({1, 2, 3, 4, 5, 6, 7}, 7, {1, 2, 3, 4, 5, 6, 7});
 }
 
-template <class Iter, class Sent = Iter>
-constexpr void test_out_iterators() {
-  test_iterators<Iter, cpp20_output_iterator<int*>, Sent>();
-  test_iterators<Iter, forward_iterator<int*>, Sent>();
-  test_iterators<Iter, bidirectional_iterator<int*>, Sent>();
-  test_iterators<Iter, random_access_iterator<int*>, Sent>();
-  test_iterators<Iter, contiguous_iterator<int*>, Sent>();
-  test_iterators<Iter, int*, Sent>();
-}
-
 constexpr bool test() {
-  test_out_iterators<forward_iterator<int*>>();
-  test_out_iterators<bidirectional_iterator<int*>>();
-  test_out_iterators<random_access_iterator<int*>>();
-  test_out_iterators<contiguous_iterator<int*>>();
-  test_out_iterators<int*>();
-  test_out_iterators<const int*>();
----------------
ldionne wrote:

It seems we dropped coverage for when the input is a `const int*`. We could probably just use `forward_iterator_list<int const*>` instead since that is more strict.

https://github.com/llvm/llvm-project/pull/126458


More information about the libcxx-commits mailing list