[libcxx-commits] [PATCH] D105795: [libcxx][algorithms] adds ranges::lower_bound and ranges::upper_bound

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 16 10:32:24 PDT 2021


cjdb added inline comments.


================
Comment at: libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/ranges_lower_bound/ranges_lower_bound.pass.cpp:33
+{
+  auto const complexity = static_cast<std::ptrdiff_t>(libcxx_log2(ranges::ssize(r))) + 1;
+  // We halve the complexity so that each test case can check both `alg(first, last)` and `alg(r)`
----------------
zoecarver wrote:
> `libcxx_log2`? Why can't we use `std::log2`?
`std::log2` isn't `constexpr` :(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105795



More information about the libcxx-commits mailing list