blob: 56779d660219b868a9ee44f84517061963d716ba [file] [log] [blame]
Eric Fiselierb08d8b12016-07-19 23:07:03 +00001
2#include <cstddef>
3
4#include "benchmark/benchmark.h"
5
6#if __cplusplus >= 201103L
7#error C++11 or greater detected. Should be C++03.
8#endif
9
10void BM_empty(benchmark::State& state) {
11 while (state.KeepRunning()) {
12 volatile std::size_t x = state.iterations();
13 ((void)x);
14 }
15}
16BENCHMARK(BM_empty);
17
18template <class T, class U>
19void BM_template2(benchmark::State& state) {
20 BM_empty(state);
21}
22BENCHMARK_TEMPLATE2(BM_template2, int, long);
23
24template <class T>
25void BM_template1(benchmark::State& state) {
26 BM_empty(state);
27}
28BENCHMARK_TEMPLATE(BM_template1, long);
29BENCHMARK_TEMPLATE1(BM_template1, int);
30
31BENCHMARK_MAIN()