diff --git a/include/fmt/format.h b/include/fmt/format.h index ed4ef1a2..6d6c2d4c 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -849,6 +849,10 @@ 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); } @@ -857,6 +861,10 @@ 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)); } @@ -865,6 +873,10 @@ 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)); } @@ -1205,11 +1217,31 @@ 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); }