4 #include <benchmark/benchmark.h>
6 void run_sizes(auto benchmark
) {
51 static void BM_std_min(benchmark::State
& state
) {
52 std::vector
<T
> vec(state
.range(), 3);
54 for (auto _
: state
) {
55 benchmark::DoNotOptimize(vec
);
56 benchmark::DoNotOptimize(std::ranges::min(vec
));
59 BENCHMARK(BM_std_min
<char>)->Apply(run_sizes
);
60 BENCHMARK(BM_std_min
<short>)->Apply(run_sizes
);
61 BENCHMARK(BM_std_min
<int>)->Apply(run_sizes
);
62 BENCHMARK(BM_std_min
<long long>)->Apply(run_sizes
);
63 BENCHMARK(BM_std_min
<__int128
>)->Apply(run_sizes
);
64 BENCHMARK(BM_std_min
<unsigned char>)->Apply(run_sizes
);
65 BENCHMARK(BM_std_min
<unsigned short>)->Apply(run_sizes
);
66 BENCHMARK(BM_std_min
<unsigned int>)->Apply(run_sizes
);
67 BENCHMARK(BM_std_min
<unsigned long long>)->Apply(run_sizes
);
68 BENCHMARK(BM_std_min
<unsigned __int128
>)->Apply(run_sizes
);