[libcxx-commits] [PATCH] D150831: [libc++] Implement ranges::ends_with
Zijun Zhao via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 26 18:41:58 PDT 2023
ZijunZhao added inline comments.
================
Comment at: libcxx/include/__algorithm/ranges_ends_with.h:43
+ _Sent2 __last2,
+ _Pred __pred = {},
+ _Proj1 __proj1 = {},
----------------
var-const wrote:
> This helper function doesn't need default arguments (since it's never invoked outside this file) and can take the predicate and the projections by reference (so there's no need to wrap the arguments passed to it in `std::ref` -- `std::ref` is only needed when passing those arguments to `ranges::equal`).
Wrapped by `std::ref` only when passing args to `ranges::equal` will cause `ranges_robust_against_copying_comparators.pass.cpp` fail.
So I only wrap them when passing args to `__ends_with_fn_impl` works.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150831/new/
https://reviews.llvm.org/D150831
More information about the libcxx-commits
mailing list