diff --git a/include/fmt/format.h b/include/fmt/format.h index bbc5ef70..d06db1cd 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -849,10 +849,6 @@ inline int count_digits(uint32_t n) { #endif template FMT_API std::string grouping_impl(locale_ref loc); -#ifndef FMT_HEADER_ONLY -extern template FMT_API std::string grouping_impl(locale_ref loc); -extern template FMT_API std::string grouping_impl(locale_ref loc); -#endif template inline std::string grouping(locale_ref loc) { return grouping_impl(loc); } @@ -861,10 +857,6 @@ template <> inline std::string grouping(locale_ref loc) { } template FMT_API Char thousands_sep_impl(locale_ref loc); -#ifndef FMT_HEADER_ONLY -extern template FMT_API char thousands_sep_impl(locale_ref loc); -extern template FMT_API wchar_t thousands_sep_impl(locale_ref loc); -#endif template inline Char thousands_sep(locale_ref loc) { return Char(thousands_sep_impl(loc)); } @@ -873,10 +865,6 @@ template <> inline wchar_t thousands_sep(locale_ref loc) { } template FMT_API Char decimal_point_impl(locale_ref loc); -#ifndef FMT_HEADER_ONLY -extern template FMT_API char decimal_point_impl(locale_ref loc); -extern template FMT_API wchar_t decimal_point_impl(locale_ref loc); -#endif template inline Char decimal_point(locale_ref loc) { return Char(decimal_point_impl(loc)); } @@ -1217,31 +1205,11 @@ template class float_writer { template int format_float(T value, int precision, float_specs specs, buffer& buf); -#ifndef FMT_HEADER_ONLY -extern template -int format_float(double value, int precision, float_specs specs, - buffer& buf); -extern template -int format_float(long double value, int precision, - float_specs specs, buffer& buf); -#endif - // Formats a floating-point number with snprintf. template int snprintf_float(T value, int precision, float_specs specs, buffer& buf); -#ifndef FMT_HEADER_ONLY -int snprintf_float(float value, int precision, float_specs specs, - buffer& buf) = delete; -extern template -int snprintf_float(double value, int precision, float_specs specs, - buffer& buf); -extern template -int snprintf_float(long double value, int precision, - float_specs specs, buffer& buf); -#endif - template T promote_float(T value) { return value; } inline double promote_float(float value) { return static_cast(value); } @@ -3369,6 +3337,28 @@ typename buffer_context::iterator internal::vformat_to( #ifndef FMT_HEADER_ONLY extern template format_context::iterator internal::vformat_to( internal::buffer&, string_view, basic_format_args); +namespace internal { +extern template FMT_API std::string grouping_impl(locale_ref loc); +extern template FMT_API std::string grouping_impl(locale_ref loc); +extern template FMT_API char thousands_sep_impl(locale_ref loc); +extern template FMT_API wchar_t thousands_sep_impl(locale_ref loc); +extern template FMT_API char decimal_point_impl(locale_ref loc); +extern template FMT_API wchar_t decimal_point_impl(locale_ref loc); +extern template +int format_float(double value, int precision, float_specs specs, + buffer& buf); +extern template +int format_float(long double value, int precision, + float_specs specs, buffer& buf); +int snprintf_float(float value, int precision, float_specs specs, + buffer& buf) = delete; +extern template +int snprintf_float(double value, int precision, float_specs specs, + buffer& buf); +extern template +int snprintf_float(long double value, int precision, + float_specs specs, buffer& buf); +} #endif template ,