[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:28 PST 2025


================
@@ -1664,10 +1664,17 @@ using forward_iterator_list = concatenate_t<bidirectional_iterator_list<Ptr>, ty
 template <class Ptr>
 using cpp17_input_iterator_list = concatenate_t<forward_iterator_list<Ptr>, type_list<cpp17_input_iterator<Ptr> > >;
 
+template <class Ptr>
+using cpp17_output_iterator_list = concatenate_t<forward_iterator_list<Ptr>, type_list<cpp17_output_iterator<Ptr> > >;
----------------
ldionne wrote:

Because of the issue we discovered in another PR earlier (about `forward_iterator` not being a valid `output_iterator`), I would avoid creating this typedef, which invites incorrect usage. Instead, I'd just use `types::for_each(types::type_list<cpp17_output_iterator concatenated with forward_iterator_list>(), TestImpl<InIter>());` in `alg.rotate/rotate_copy.pass.cpp`.

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


More information about the libcxx-commits mailing list