Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61164812
templated_fixture_test.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, May 4, 22:54
Size
482 B
Mime Type
text/x-c++
Expires
Mon, May 6, 22:54 (2 d)
Engine
blob
Format
Raw Data
Handle
17474614
Attached To
R12667 gbench-stream
templated_fixture_test.cc
View Options
#include <cassert>
#include <memory>
#include "benchmark/benchmark.h"
template <typename T>
class MyFixture : public ::benchmark::Fixture {
public:
MyFixture() : data(0) {}
T data;
};
BENCHMARK_TEMPLATE_F(MyFixture, Foo, int)(benchmark::State& st) {
for (auto _ : st) {
data += 1;
}
}
BENCHMARK_TEMPLATE_DEFINE_F(MyFixture, Bar, double)(benchmark::State& st) {
for (auto _ : st) {
data += 1.0;
}
}
BENCHMARK_REGISTER_F(MyFixture, Bar);
BENCHMARK_MAIN();
Event Timeline
Log In to Comment