[libcxx-commits] [libcxx] [libc++] Rewrite the std::lower_bound benchmark to be more efficient and add an upper_bound benchmark (PR #177180)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jan 26 08:47:56 PST 2026
================
@@ -0,0 +1,86 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+
+#include <algorithm>
+#include <deque>
+#include <forward_list>
+#include <list>
+#include <numeric>
+#include <random>
+#include <vector>
+
+#include "benchmark/benchmark.h"
+#include "../../GenerateInput.h"
+
+int main(int argc, char** argv) {
+ {
+ auto bm = []<class Container>(benchmark::State& state) static {
----------------
ldionne wrote:
```suggestion
auto bm = []<class Container>(benchmark::State& state) {
```
https://github.com/llvm/llvm-project/pull/177180
More information about the libcxx-commits
mailing list