[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 19:14:49 PDT 2023
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:
> 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.
I see! Thank you!
================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/alg.starts_with/ranges.starts_with.pass.cpp:32
+
+template <class Iter1, class Sent1, class Iter2, class Sent2 = Iter2>
+constexpr void test_iterators() {
----------------
philnik wrote:
> Looks like clang-format does weird things again. Please update the formatting.
Are there any command instructions to disable clang-format? I fixed part of the code manually 😂
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