[libcxx-commits] [libcxx] [libc++] Use views::reverse to implement ranges::reverse_copy (PR #177123)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 28 07:56:34 PST 2026


================
@@ -49,7 +50,7 @@ struct __reverse_copy {
     requires indirectly_copyable<iterator_t<_Range>, _OutIter>
   _LIBCPP_HIDE_FROM_ABI constexpr reverse_copy_result<borrowed_iterator_t<_Range>, _OutIter>
   operator()(_Range&& __range, _OutIter __result) const {
-    auto __ret = ranges::copy(std::__reverse_range(__range), std::move(__result));
----------------
ldionne wrote:

It seems like this utility initially came from https://reviews.llvm.org/D127211#inline-1243171, where we were trying to avoid pulling in too many dependencies. Is that rationale still relevant? If not, let's leave a trace in the PR description.

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


More information about the libcxx-commits mailing list