| 1962 | |
| 1963 | template<typename Benchmark> |
| 1964 | void queue_instance(Benchmark&& instance) |
| 1965 | { |
| 1966 | apply_settings(benchmark::RegisterBenchmark( |
| 1967 | instance.name().c_str(), |
| 1968 | [=](benchmark::State& gbench_state) |
| 1969 | { |
| 1970 | // run() requires a mutable instance, so create a mutable copy. |
| 1971 | // Using [&instance] doesn't work, as it creates a dangling reference at runtime. |
| 1972 | // Marking the lambda mutable doesn't work, as the &&instance it copies is const. |
| 1973 | Benchmark(std::move(instance)).run(new_state(gbench_state)); |
| 1974 | })); |
| 1975 | } |
| 1976 | |
| 1977 | template<typename Benchmark> |
| 1978 | static bool queue_sorted_instance() |
no test coverage detected