/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Utilities/General/test/google-benchmark-basic.cpp
18 строк
481 B
Andrea Bocci
Add NOLINT comments to prevent clang-tidy false positives
18 май 2020, 13:26
Не верифицирован
18 май 2020, 13:26
3d1f297
Код
Авторство
О чём код?
#include <benchmark/benchmark.h> static void BM_StringCreation(benchmark::State& state) { for (auto _ : state) 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"; for (auto _ : state) std::string copy(x); // NOLINT - prevent clang-tidy from changing to a `const &` } BENCHMARK(BM_StringCopy); BENCHMARK_MAIN();