diff options
author | Eric Fiselier <eric@efcs.ca> | 2015-03-17 12:21:20 -0400 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2015-03-17 12:21:20 -0400 |
commit | 1924b30a6c45a6c305393bab102fb28333c38543 (patch) | |
tree | c82dea300a924312192f821a856d65d643a7596e /include/benchmark | |
parent | 957a3e339ecb8bf0b9088be857fa6f3df6e4bc66 (diff) | |
parent | 180981716ba7b568820aa21ecf15247b990a8621 (diff) | |
download | google-benchmark-1924b30a6c45a6c305393bab102fb28333c38543.tar.gz |
Merge null pointer warnings
Diffstat (limited to 'include/benchmark')
-rw-r--r-- | include/benchmark/benchmark.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/include/benchmark/benchmark.h b/include/benchmark/benchmark.h index 8f5b219..2738e68 100644 --- a/include/benchmark/benchmark.h +++ b/include/benchmark/benchmark.h @@ -152,7 +152,8 @@ void Initialize(int* argc, const char** argv); // Otherwise, run all benchmarks specified by the --benchmark_filter flag, // and exit after running the benchmarks. -void RunSpecifiedBenchmarks(const BenchmarkReporter* reporter = NULL); +void RunSpecifiedBenchmarks(); +void RunSpecifiedBenchmarks(const BenchmarkReporter* reporter); // If this routine is called, peak memory allocation past this point in the // benchmark is reported at the end of the benchmark report line. (It is @@ -164,7 +165,20 @@ void RunSpecifiedBenchmarks(const BenchmarkReporter* reporter = NULL); namespace internal { class Benchmark; class BenchmarkImp; -} + +template <class T> struct Voider { + typedef void type; +}; + +template <class T, class = void> +struct EnableIfString {}; + +template <class T> +struct EnableIfString<T, typename Voider<typename T::basic_string>::type> { + typedef int type; +}; + +} // end namespace internal // State is passed to a running Benchmark and contains state for the // benchmark to use. @@ -279,7 +293,7 @@ public: // as an injected class name in the case of std::string. template <class StringType> void SetLabel(StringType const & str, - typename StringType::basic_string* = 0) { + typename internal::EnableIfString<StringType>::type = 1) { this->SetLabel(str.c_str()); } |