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

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 29 04:25:51 PDT 2022


philnik added inline comments.


================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find_if.pass.cpp:232
+      ImmobileBool a[] = {false, false, false, true};
+      auto ret = std::ranges::find_if(a, a + 4, [](const ImmobileBool& b) { return true == b; });
+      assert(ret == a + 3);
----------------
var-const wrote:
> Can you add an explicit return type to make it clear that we're also testing that the algorithm supports predicates that return something convertible to `bool`, not just `bool`? (assuming I'm understanding the intention correctly) Applies to `find_if_not` as well.
I think this comment doesn't apply anymore. LMK if I'm wrong.


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