[libcxx-commits] [PATCH] D150146: [libc++] Implement ranges::starts_with
Nikolas Klauser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed May 10 16:46:22 PDT 2023
philnik 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);
----------------
ZijunZhao wrote:
> 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`
You can call the actual implementation instead of the public interface to avoid that.
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