[libcxx-commits] [PATCH] D121964: [libc++][ranges] Implement ranges::binary_search and ranges::{lower, upper}_bound

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Apr 24 08:43:05 PDT 2022


philnik marked 2 inline comments as done.
philnik added inline comments.


================
Comment at: libcxx/include/CMakeLists.txt:78
+  __algorithm/ranges_binary_search.h
+  __algorithm/ranges_find.h
+  __algorithm/ranges_find_if.h
----------------
Mordante wrote:
> Were these files not already in `CMakeLists.txt`?
I guess you mean the `find` things? Must have been a merge conflict.


================
Comment at: libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/ranges.binary_search.pass.cpp:163
+    assert(std::ranges::binary_search(a, a + 5, 6, Func{}));
+  }
+
----------------
Mordante wrote:
> Please add some tests for the complexity requirements for comparisons and projections.
> The same for `lower_bound` and `upper_bound`.
How exactly would you like them to look like? The standard says that the complexity is `log_2(last - first) + O(1)` How could I (without a statistical analysis) find out what the constant is?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121964



More information about the libcxx-commits mailing list