diff --git a/include/fmt/core.h b/include/fmt/core.h index 7f679278..4e295114 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -2701,14 +2701,10 @@ template class format_string_checker { type types_[num_args > 0 ? static_cast(num_args) : 1]; public: - explicit FMT_CONSTEXPR format_string_checker( - basic_string_view format_str) - : context_(format_str, num_args, types_), + explicit FMT_CONSTEXPR format_string_checker(basic_string_view fmt) + : context_(fmt, num_args, types_), parse_funcs_{&parse_format_specs...}, - types_{ - mapped_type_constant>::value...} { - } + types_{mapped_type_constant>::value...} {} FMT_CONSTEXPR void on_text(const Char*, const Char*) {} @@ -2965,8 +2961,7 @@ template FMT_NODISCARD FMT_INLINE auto formatted_size(format_string fmt, T&&... args) -> size_t { auto buf = detail::counting_buffer<>(); - detail::vformat_to(buf, string_view(fmt), - format_args(fmt::make_format_args(args...)), {}); + detail::vformat_to(buf, fmt, fmt::make_format_args(args...), {}); return buf.count(); } diff --git a/include/fmt/format.h b/include/fmt/format.h index d36fe217..d34e23c4 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3727,12 +3727,12 @@ template struct udl_arg { #endif // FMT_USE_USER_DEFINED_LITERALS template -auto vformat(const Locale& loc, basic_string_view format_str, +auto vformat(const Locale& loc, basic_string_view fmt, basic_format_args>> args) -> std::basic_string { - basic_memory_buffer buffer; - detail::vformat_to(buffer, format_str, args, detail::locale_ref(loc)); - return {buffer.data(), buffer.size()}; + auto buf = basic_memory_buffer(); + detail::vformat_to(buf, fmt, args, detail::locale_ref(loc)); + return {buf.data(), buf.size()}; } using format_func = void (*)(detail::buffer&, int, const char*); @@ -4299,9 +4299,8 @@ FMT_NODISCARD FMT_INLINE auto formatted_size(const Locale& loc, format_string fmt, T&&... args) -> size_t { auto buf = detail::counting_buffer<>(); - detail::vformat_to(buf, string_view(fmt), - format_args(fmt::make_format_args(args...)), - detail::locale_ref(loc)); + detail::vformat_to(buf, fmt, fmt::make_format_args(args...), + detail::locale_ref(loc)); return buf.count(); }