[libcxx-commits] [PATCH] D124440: [libc++] Implement ranges::is_partitioned
Nikolas Klauser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue May 3 04:11:00 PDT 2022
philnik added inline comments.
================
Comment at: libcxx/test/std/algorithms/alg.sorting/alg.partitions/ranges.is_partitioned.pass.cpp:41
+
+template <class Iter, class Sent = Iter>
+constexpr void test_iterators() {
----------------
var-const wrote:
> Optional: I think you could implement a helper function that takes care of both the iterator/sentinel and the ranges overloads. The main advantage would be more succinct callsites:
> ```
> assert(test({1, 2, 3, 4, 5}, [](int i) { return i < 3; }));
> assert(test({1, 2, 3, 4}, [](int i) { return true; }));
> ...
> ```
I'll try it for the next algorithm I implement. Maybe I'll change it then for all of them.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124440/new/
https://reviews.llvm.org/D124440
More information about the libcxx-commits
mailing list