google / google/benchmark

[FR] Customized Args

Open
#1,461 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
10.4k
Forks
1.8k
Avg merge
2d 4h
Merged PRs (30d)
8

Description

Hi, I am requesting you to suggest if there is anyway to pass poinetrs to class objects or pointers to char as argument to benchmar wrapper function. I am looking for something like
//Dummy class
class Demo
{
};

//function to benchmark
void play(Demo* ob, char* ch);

//wrapper
static void BM_play(benchmark::State& state)
{
for(auto _ : state)
{
play(state.range(0), state.range(1)); // Here I only know to pass int64
}
}

can you please help?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.