Iterators benchmark
#include <list>
#include <vector>
template <typename T>
class ContainerFixture
{
protected:
T container;
ContainerFixture()
{
for (int i = 0; i < 1000000; ++i)
container.push_back(rand());
}
};
{
for (auto it = container.begin(); it != container.end(); ++it)
++(*it);
}
{
for (auto it = container.rbegin(); it != container.rend(); ++it)
++(*it);
}
{
for (auto it = container.begin(); it != container.end(); ++it)
++(*it);
}
{
for (auto it = container.rbegin(); it != container.rend(); ++it)
++(*it);
}
CppBenchmark definitions.
#define BENCHMARK_FIXTURE(fixture,...)
Benchmark with fixture register macro.
#define BENCHMARK_MAIN()
Benchmark main entry point macro.