diff --git a/include/fmt/format.h b/include/fmt/format.h index b13bc4cf..f2ee623d 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2157,29 +2157,19 @@ FMT_CONSTEXPR FMT_NOINLINE auto write_int_noinline(OutputIt out, return write_int(out, arg, specs); } -template ::value && - !std::is_same::value && - !std::is_same::value)> -FMT_CONSTEXPR FMT_INLINE auto write(basic_appender out, T value, - const format_specs& specs, locale_ref loc) - -> basic_appender { - if (specs.localized() && write_loc(out, value, specs, loc)) return out; - return write_int_noinline(out, make_write_int_arg(value, specs.sign()), - specs); -} - -// An inlined version of write used in format string compilation. template ::value && !std::is_same::value && - !std::is_same::value && - !std::is_same>::value)> + !std::is_same::value)> FMT_CONSTEXPR FMT_INLINE auto write(OutputIt out, T value, const format_specs& specs, locale_ref loc) -> OutputIt { if (specs.localized() && write_loc(out, value, specs, loc)) return out; - return write_int(out, make_write_int_arg(value, specs.sign()), specs); + auto arg = make_write_int_arg(value, specs.sign()); + // Out of line for appenders to avoid bloat; inlined for compiled formatting. + if FMT_CONSTEXPR20 (std::is_same>::value) + return write_int_noinline(out, arg, specs); + return write_int(out, arg, specs); } template