Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example does not compile #65

Closed
DaimonPl opened this issue Nov 12, 2014 · 0 comments
Closed

Example does not compile #65

DaimonPl opened this issue Nov 12, 2014 · 0 comments

Comments

@DaimonPl
Copy link

Just wanted to try first example with head version of master branch (d750144):

error: cannot initialize a parameter of type 'const char **' with an lvalue of type 'char **'
benchmark::Initialize(&argc, argv);

Of course it can be easily fixed manually, but it's always better if example compiles :)

For reference I just copied example (and added proper include):

#include <string>
#include "benchmark/benchmark.h"

static void BM_StringCreation(benchmark::State& state) {
  while (state.KeepRunning())
    std::string empty_string;
}
// Register the function as a benchmark
BENCHMARK(BM_StringCreation);

// Define another benchmark
static void BM_StringCopy(benchmark::State& state) {
  std::string x = "hello";
  while (state.KeepRunning())
    std::string copy(x);
}
BENCHMARK(BM_StringCopy);

// Augment the main() program to invoke benchmarks if specified
// via the --benchmarks command line flag.  E.g.,
//       my_unittest --benchmark_filter=all
//       my_unittest --benchmark_filter=BM_StringCreation
//       my_unittest --benchmark_filter=String
//       my_unittest --benchmark_filter='Copy|Creation'
int main(int argc, char** argv) {
  benchmark::Initialize(&argc, argv);
  benchmark::RunSpecifiedBenchmarks();
  return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant