aboutsummaryrefslogtreecommitdiff
path: root/include/benchmark
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2015-03-12 19:16:06 -0400
committerEric Fiselier <eric@efcs.ca>2015-03-12 19:16:06 -0400
commit64ba272911c2413cee516af849c4c80d7ae993b9 (patch)
treee1e04ef3872fa1bc8a00c8cb51a691c280a944ba /include/benchmark
parent19464f7dab7d3029b89069ea8add6d54eaf08c9b (diff)
downloadgoogle-benchmark-64ba272911c2413cee516af849c4c80d7ae993b9.tar.gz
Enable zero as NULL warnings and fix all occurences
Diffstat (limited to 'include/benchmark')
-rw-r--r--include/benchmark/benchmark.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/benchmark/benchmark.h b/include/benchmark/benchmark.h
index aa80bbc..f796dc3 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,6 +165,19 @@ void RunSpecifiedBenchmarks(const BenchmarkReporter* reporter = NULL);
namespace internal {
class Benchmark;
class BenchmarkFamilies;
+
+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;
+};
+
}
// State is passed to a running Benchmark and contains state for the
@@ -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());
}