[libcxx-commits] [PATCH] D123016: [libc++] Implement ranges::{all, any, none}_of

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 4 15:24:52 PDT 2022


var-const added inline comments.


================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/alg.all_of/ranges.all_of.pass.cpp:30
+template <class It, class Sent = sentinel_wrapper<It>>
+concept HasAllOfIt = requires(It first, Sent last) { std::ranges::all_of(first, last, std::identity{}); };
+
----------------
philnik wrote:
> var-const wrote:
> > Why is `std::identity` passed explicitly here, instead of relying on the default argument?
> There is no default argument. This is the predicate.
Ah, right -- seeing `std::identity`, I mistook it for the projection. Perhaps change it to something else that looks more like a predicate (you could create a simple global functor like `AlwaysTrue` or similar and reuse it across the tests if you'd like)?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123016

STAMPS
actor(@var-const) application(Differential) author(@philnik) herald(H157) herald(H426) herald(H576) herald(H864) monogram(D123016) object-type(DREV) phid(PHID-DREV-pti6hyloohmsjdja55ji) reviewer(#libc) reviewer(@ldionne) reviewer(@Mordante) reviewer(@var-const) revision-repository(rG) revision-status(needs-revision) subscriber(@libcxx-commits) subscriber(@mgorny) tag(#all) tag(#libc) via(web)



More information about the libcxx-commits mailing list