diff --git a/include/fmt/format.h b/include/fmt/format.h index 8bb854f5..2e782926 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -833,6 +833,12 @@ inline int count_digits(uint32_t n) { } #endif +template constexpr int digits10() FMT_NOEXCEPT { + return std::numeric_limits::digits10; +} +template <> constexpr int digits10() FMT_NOEXCEPT { return 38; } +template <> constexpr int digits10() FMT_NOEXCEPT { return 38; } + template FMT_API std::string grouping_impl(locale_ref loc); template inline std::string grouping(locale_ref loc) { return grouping_impl(loc); @@ -857,6 +863,7 @@ template <> inline wchar_t decimal_point(locale_ref loc) { return decimal_point_impl(loc); } +// Compares two characters for equality. template bool equal2(const Char* lhs, const char* rhs) { return lhs[0] == rhs[0] && lhs[1] == rhs[1]; } @@ -864,6 +871,7 @@ inline bool equal2(const char* lhs, const char* rhs) { return memcmp(lhs, rhs, 2) == 0; } +// Copies two characters from src to dst. template void copy2(Char* dst, const char* src) { *dst++ = static_cast(*src++); *dst = static_cast(*src); @@ -892,12 +900,6 @@ inline Char* format_decimal(Char* out, UInt value, int num_digits) { return end; } -template constexpr int digits10() FMT_NOEXCEPT { - return std::numeric_limits::digits10; -} -template <> constexpr int digits10() FMT_NOEXCEPT { return 38; } -template <> constexpr int digits10() FMT_NOEXCEPT { return 38; } - template >::value)> inline Iterator format_decimal(Iterator out, UInt value, int num_digits) {