From 83808076e3b96bdcc560b004b22b2e29720b8ea2 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 13 Feb 2019 06:14:22 -0800 Subject: [PATCH] Minor cleanup --- include/fmt/core.h | 9 ++------- include/fmt/format-inl.h | 8 ++------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index dca3c2e0..2bae6615 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1388,13 +1388,8 @@ typename buffer_context::type::iterator vformat_to( fmt::print("Elapsed time: {s:.2f} seconds", fmt::arg("s", 1.23)); \endrst */ -template -inline internal::named_arg arg(string_view name, const T& arg) { - return {name, arg}; -} - -template -inline internal::named_arg arg(wstring_view name, const T& arg) { +template +inline internal::named_arg arg(const S& name, const T& arg) { return {name, arg}; } diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 783465c2..cab36c9b 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -419,12 +419,6 @@ inline fp operator-(fp x, fp y) { // Computes an fp number r with r.f = x.f * y.f / pow(2, 64) rounded to nearest // with half-up tie breaking, r.e = x.e + y.e + 64. Result may not be // normalized. -FMT_API fp operator*(fp x, fp y); - -// Returns cached power (of 10) c_k = c_k.f * pow(2, c_k.e) such that its -// (binary) exponent satisfies min_exponent <= c_k.e <= min_exponent + 3. -FMT_API fp get_cached_power(int min_exponent, int& pow10_exponent); - FMT_FUNC fp operator*(fp x, fp y) { // Multiply 32-bit parts of significands. uint64_t mask = (1ULL << 32) - 1; @@ -436,6 +430,8 @@ FMT_FUNC fp operator*(fp x, fp y) { return fp(ac + (ad >> 32) + (bc >> 32) + (mid >> 32), x.e + y.e + 64); } +// Returns cached power (of 10) c_k = c_k.f * pow(2, c_k.e) such that its +// (binary) exponent satisfies min_exponent <= c_k.e <= min_exponent + 28. FMT_FUNC fp get_cached_power(int min_exponent, int& pow10_exponent) { const double one_over_log2_10 = 0.30102999566398114; // 1 / log2(10) int index = static_cast(