[libcxx-commits] [PATCH] D129806: [libc++] Implement ranges::replace_copy{, _if}

Hui via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 15 06:35:11 PDT 2022


huixie90 accepted this revision.
huixie90 added inline comments.


================
Comment at: libcxx/include/__algorithm/ranges_replace_copy.h:1
 //===----------------------------------------------------------------------===//
 //
----------------
could you please update the status csv file?


================
Comment at: libcxx/include/__algorithm/ranges_replace_copy.h:40
 
-struct __fn {
-
-  template <input_iterator _InIter, sentinel_for<_InIter> _Sent, class _Type1, class _Type2,
-            output_iterator<const _Type2&> _OutIter, class _Proj = identity>
-  requires indirectly_copyable<_InIter, _OutIter> &&
-           indirect_binary_predicate<ranges::equal_to, projected<_InIter, _Proj>, const _Type1*>
-  _LIBCPP_HIDE_FROM_ABI constexpr
-  replace_copy_result<_InIter, _OutIter>
-  operator()(_InIter __first, _Sent __last, _OutIter __result, const _Type1& __old_value, const _Type2& __new_value,
+  struct __fn {
+    template <input_iterator _InIter,
----------------
puzzle: why does clang-format add two spaces here. I was told don't have spaces here


================
Comment at: libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges_replace_copy.pass.cpp:66-67
+  std::array<int, N> input;
+  int old_value;
+  int new_value;
+  std::array<int, N> expected;
----------------
since the signature of the algorithm have OldType and NewType, it would be good to have at least one test to test when the `old_value` and `new_value` have different types


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129806



More information about the libcxx-commits mailing list