[libcxx-commits] [PATCH] D150146: [libc++] Implement ranges::starts_with

Zijun Zhao via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 10 16:43:58 PDT 2023


ZijunZhao marked 3 inline comments as done.
ZijunZhao added inline comments.


================
Comment at: libcxx/include/__algorithm/ranges_starts_with.h:57
+      _Proj2 __proj2 = {}) const {
+    return __starts_with_impl(
+        std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), __pred, __proj1, __proj2);
----------------
philnik wrote:
> I think we should just forward this for `ranges::equal` (for random access ranges) or `ranges::mismatch` (otherwise) to grab any optimizations that are done there.
yes, I used `ranges::mismatch` directly before but the comparators and projections will be copied, which fail `ranges_robust_against_copying_comparators.pass.cpp` and `ranges_robust_against_copying_projections.pass.cpp`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150146



More information about the libcxx-commits mailing list