[libcxx-commits] [PATCH] D130404: [libc++][ranges] implement `std::ranges::unique{_copy}`

Hui via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 27 05:52:48 PDT 2022


huixie90 added inline comments.


================
Comment at: libcxx/include/__algorithm/unique_copy.h:80
 
-template <class _BinaryPredicate, class _InputIterator, class _ForwardIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
-__unique_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _BinaryPredicate __pred,
-              input_iterator_tag, forward_iterator_tag)
-{
-    if (__first != __last)
-    {
-        *__result = *__first;
-        while (++__first != __last)
-            if (!__pred(*__result, *__first))
-                *++__result = *__first;
-        ++__result;
-    }
-    return __result;
+template <class _AlgPolicy, class _BinaryPredicate, class _InputIterator, class _Sent, class _InputOutputIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _InputOutputIterator> __unique_copy_impl(
----------------
var-const wrote:
> Perhaps `InputOrOutputIterator`?
Renamed to `InputAndOutputIterator`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130404



More information about the libcxx-commits mailing list