benchmarks/string.bench.cpp
static void BM_StringFindNoMatch(benchmark::State &state) {
  std::string s1(state.range(0), '-');
  std::string s2(8, '*');
  while (state.KeepRunning())
    benchmark::DoNotOptimize(s1.find(s2));
}
// Benchmark when there is no match.
Benchmark when there is no match.
Benchmark when there is no match .
static void BM_StringFindNoMatch(benchmark::State &state) {
  std::string s1(state.range(0), '-');
  std::string s2(8, '*');
  while (state.KeepRunning())
    benchmark::DoNotOptimize(s1.find(s2));
}
static void BM_StringFindNoMatch ( benchmark :: State & state ) { std :: string s1 ( state . range ( 0 ) , ' ' ) ; std :: string s2 ( 8 , ' ' ) ; while ( state . KeepRunning ( ) ) benchmark :: DoNotOptimize ( s1 . find ( s2 ) ) ; }
Benchmark when there is no match.
Benchmark when there is no match .