#include "fibonacci.h" #include #include #include const auto seed = std::random_device()(); std::default_random_engine engine(seed); std::uniform_int_distribution distribution(0, 30); auto rng = std::bind(distribution, engine); template void test(benchmark::State &state) { std::size_t t = 0; engine.seed(seed); for (auto _ : state) t += f(rng()); std::ostream cnull(0); cnull << t; } template void register_benchmark() { BENCHMARK(test>); BENCHMARK(test>); BENCHMARK(test>); BENCHMARK(test>); BENCHMARK(test>); BENCHMARK(test>); BENCHMARK(test>); BENCHMARK(test>); BENCHMARK(test>); } template struct Init { Init() { register_benchmark(); } }; Init init; BENCHMARK_MAIN();