diff options
author | 2018-09-11 18:18:58 +0000 | |
---|---|---|
committer | 2018-09-11 18:18:58 +0000 | |
commit | 820e1f31efc1d6ed04795ba2e79f3044e1907492 (patch) | |
tree | 815cebb3734784074b661935c33f00bd5eb4d862 /lib/libcxx/utils/google-benchmark/src/string_util.h | |
parent | Nuke unused LIST() ieee80211com_head. (diff) | |
download | wireguard-openbsd-820e1f31efc1d6ed04795ba2e79f3044e1907492.tar.xz wireguard-openbsd-820e1f31efc1d6ed04795ba2e79f3044e1907492.zip |
import of libc++ 6.0.0
Diffstat (limited to 'lib/libcxx/utils/google-benchmark/src/string_util.h')
-rw-r--r-- | lib/libcxx/utils/google-benchmark/src/string_util.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/libcxx/utils/google-benchmark/src/string_util.h b/lib/libcxx/utils/google-benchmark/src/string_util.h new file mode 100644 index 00000000000..0b190b91a16 --- /dev/null +++ b/lib/libcxx/utils/google-benchmark/src/string_util.h @@ -0,0 +1,40 @@ +#ifndef BENCHMARK_STRING_UTIL_H_ +#define BENCHMARK_STRING_UTIL_H_ + +#include <sstream> +#include <string> +#include <utility> +#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 <class First, class... Rest> +inline std::ostream& StringCatImp(std::ostream& out, First&& f, + Rest&&... rest) { + out << std::forward<First>(f); + return StringCatImp(out, std::forward<Rest>(rest)...); +} + +template <class... Args> +inline std::string StrCat(Args&&... args) { + std::ostringstream ss; + StringCatImp(ss, std::forward<Args>(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_ |