diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index bb8858b4..9a9d9dbd 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -214,13 +214,10 @@ class locale { namespace internal { template -FMT_FUNC Char thousands_sep(locale_provider *lp) { +FMT_FUNC Char thousands_sep_impl(locale_provider *lp) { std::locale loc = lp ? lp->locale().get() : std::locale(); return std::use_facet>(loc).thousands_sep(); } -template <> FMT_FUNC char8_t thousands_sep(locale_provider *) { - return static_cast(','); -} } #else template diff --git a/include/fmt/format.h b/include/fmt/format.h index f05c5106..e95466af 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1034,7 +1034,17 @@ class add_thousands_sep { }; template -FMT_API Char thousands_sep(locale_provider *lp); +FMT_API Char thousands_sep_impl(locale_provider *lp); + +template +inline Char thousands_sep(locale_provider *lp) { + return Char(thousands_sep_impl(lp)); +} + +template <> +inline wchar_t thousands_sep(locale_provider *lp) { + return thousands_sep_impl(lp); +} // Formats a decimal unsigned integer value writing into buffer. // thousands_sep is a functor that is called after writing each char to @@ -3416,7 +3426,7 @@ struct it_category::type> { typedef typename T::iterator_category type; }; -// Detect if *any* given type models the OutputIterator concept +// Detect if *any* given type models the OutputIterator concept. template class is_output_iterator { // Check for mutability because all iterator categories derived from @@ -3434,10 +3444,9 @@ class is_output_iterator { typedef decltype(test(typename it_category::type{})) type; typedef typename std::remove_reference::type result; -public: + public: static const bool value = !std::is_const::value; }; - } // internal template diff --git a/src/format.cc b/src/format.cc index 8f7a5991..e37c61cf 100644 --- a/src/format.cc +++ b/src/format.cc @@ -12,7 +12,7 @@ template struct internal::basic_data; // Explicit instantiations for char. -template FMT_API char internal::thousands_sep(locale_provider *lp); +template FMT_API char internal::thousands_sep_impl(locale_provider *lp); template void internal::basic_buffer::append(const char *, const char *); @@ -38,7 +38,7 @@ template FMT_API void internal::sprintf_format( // Explicit instantiations for wchar_t. -template FMT_API wchar_t internal::thousands_sep(locale_provider *); +template FMT_API wchar_t internal::thousands_sep_impl(locale_provider *); template void internal::basic_buffer::append( const wchar_t *, const wchar_t *);