[libcxx-commits] [libcxx] [libc++] avoid using `ranges::advance` and `ranges::next` in all algorithms (PR #179095)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Sat Feb 7 02:36:15 PST 2026


================
@@ -161,7 +161,7 @@ struct __copy_backward_impl {
   template <class _InIter, class _Sent, class _OutIter>
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
   operator()(_InIter __first, _Sent __last, _OutIter __result) const {
-    auto __last_iter          = _IterOps<_AlgPolicy>::next(__first, __last);
+    auto __last_iter          = _IterOps<_AlgPolicy>::__next_sentinel(__first, __last);
----------------
philnik777 wrote:

I don't think `__next_until` is any clearer. I actually think it's significantly worse, since it sounds like you're passing a functor of some kind.

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


More information about the libcxx-commits mailing list