[libcxx-commits] [PATCH] D122011: [libc++][ranges] Add implicit conversion to bool test for ranges::find{, if, if_not}

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 18 08:50:56 PDT 2022


ldionne added inline comments.


================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find_if_not.pass.cpp:225-227
+      ImmobileBool a[] = {false, false, false, true};
+      auto ret = std::ranges::find_if_not(a, a + 4, [](const ImmobileBool& b) { return true != b; });
+      assert(ret == a + 3);
----------------
WDYT? IMO this clarifies exactly what we're testing.


================
Comment at: libcxx/test/support/immobile_bool.h:1
+//===----------------------------------------------------------------------===//
+//
----------------
How about `BooleanTestable`, since this is roughly an archetype for being boolean-testable?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122011



More information about the libcxx-commits mailing list