[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / libcxx / benchmarks / algorithms / ranges_push_heap.bench.cpp
blob902f481228e4662aa6eb3510b5e5077c1f67b60a
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include <algorithm>
11 #include "common.h"
13 namespace {
14 template <class ValueType, class Order>
15 struct RangesPushHeap {
16 size_t Quantity;
18 void run(benchmark::State& state) const {
19 runOpOnCopies<ValueType>(state, Quantity, Order(), BatchSize::CountElements, [](auto& Copy) {
20 for (auto I = Copy.begin(), E = Copy.end(); I != E; ++I) {
21 std::ranges::push_heap(Copy.begin(), I + 1);
23 });
26 bool skip() const { return Order() == ::Order::Heap; }
28 std::string name() const {
29 return "BM_RangesPushHeap" + ValueType::name() + Order::name() + "_" + std::to_string(Quantity);
32 } // namespace
34 int main(int argc, char** argv) {
35 benchmark::Initialize(&argc, argv);
36 if (benchmark::ReportUnrecognizedArguments(argc, argv))
37 return 1;
38 makeCartesianProductBenchmark<RangesPushHeap, AllValueTypes, AllOrders>(Quantities);
39 benchmark::RunSpecifiedBenchmarks();