From 042050ef67a0d320469a6f8ca74bd8684ec4c409 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 29 Jan 2016 11:47:40 +0100 Subject: Added Google Benchmark library (nw) Included sample benchmark for eminline for native and noasm Made GoogleTest compile only if tests are compiled --- 3rdparty/benchmark/src/string_util.h | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 3rdparty/benchmark/src/string_util.h (limited to '3rdparty/benchmark/src/string_util.h') diff --git a/3rdparty/benchmark/src/string_util.h b/3rdparty/benchmark/src/string_util.h new file mode 100644 index 00000000000..b89fef5ff36 --- /dev/null +++ b/3rdparty/benchmark/src/string_util.h @@ -0,0 +1,44 @@ +#ifndef BENCHMARK_STRING_UTIL_H_ +#define BENCHMARK_STRING_UTIL_H_ + +#include +#include +#include +#include "internal_macros.h" + +namespace benchmark { + +void AppendHumanReadable(int n, std::string* str); + +std::string HumanReadableNumber(double n); + +std::string StringPrintF(const char* format, ...); + +inline std::ostream& +StringCatImp(std::ostream& out) BENCHMARK_NOEXCEPT +{ + return out; +} + +template +inline std::ostream& +StringCatImp(std::ostream& out, First&& f, Rest&&... rest) +{ + out << std::forward(f); + return StringCatImp(out, std::forward(rest)...); +} + +template +inline std::string StrCat(Args&&... args) +{ + std::ostringstream ss; + StringCatImp(ss, std::forward(args)...); + return ss.str(); +} + +void ReplaceAll(std::string* str, const std::string& from, + const std::string& to); + +} // end namespace benchmark + +#endif // BENCHMARK_STRING_UTIL_H_ -- cgit v1.2.3-70-g09d2