[libcxx-commits] [PATCH] D117817: [libc++][ranges] Implement ranges::mismatch

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 8 04:49:12 PST 2022


philnik added inline comments.


================
Comment at: libcxx/include/__algorithm/ranges_mismatch.h:61
+                                       _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
+    return __go(std::move(__first1), __last1, std::move(__first2), __last2, __pred, __proj1, __proj2);
+  }
----------------
ldionne wrote:
> Any reason why we don't implement the algorithm here and then call `*this` in the range version immediately below?
With the current implementation the predicates and projections are never moved. using `*this()` would mean we have to move them at least once.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117817



More information about the libcxx-commits mailing list