[libcxx-commits] [PATCH] D122982: [libc++] Implement ranges::copy{, _n, _if, _backward}

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 14 11:01:31 PDT 2022


Mordante accepted this revision.
Mordante added a comment.
This revision is now accepted and ready to land.

LGTM!



================
Comment at: libcxx/include/__algorithm/copy_backward.h:29
+pair<_Iter1, _Iter2> __copy_backward_impl(_Iter1 __first, _Sent1 __last, _Iter2 __result) {
+  auto __ret = std::__copy(reverse_iterator<_Sent1>(__last),
+                           reverse_iterator<_Iter1>(__first),
----------------
philnik wrote:
> var-const wrote:
> > Optional: `make_reverse_iterator` to omit the type?
> This isn't available in C++03 and C++11.
What I've done in the past for similar cases is add `__make_reverse_iterator` and let `make_reverse_iterator` call that function. Just something to keep in mind, no need to change it now.


================
Comment at: libcxx/include/__algorithm/ranges_copy_n.h:55
+    auto __ret = std::__copy(__first, __first + __n, __result);
+    return {__ret.first, __ret.second};
+  }
----------------
How do you feel about moving these iterators for consistency?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122982/new/

https://reviews.llvm.org/D122982



More information about the libcxx-commits mailing list