diff --git a/include/fmt/base.h b/include/fmt/base.h index 60972421..fe297410 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -1774,7 +1774,7 @@ FMT_CONSTEXPR auto invoke_parse(parse_context& ctx) -> const Char* { #if defined(__cpp_if_constexpr) if constexpr (std::is_default_constructible>()) return formatter().parse(ctx); - return ctx.begin(); // Ignore the error - it is reported by make_format_args. + return ctx.begin(); // Ignore the error - it is reported in the value ctor. #else return formatter().parse(ctx); #endif @@ -2935,7 +2935,7 @@ template ::value)> FMT_INLINE auto format_to(OutputIt&& out, format_string fmt, T&&... args) -> remove_cvref_t { - return vformat_to(FMT_FWD(out), fmt, fmt::make_format_args(args...)); + return vformat_to(FMT_FWD(out), fmt, vargs{{args...}}); } template struct format_to_n_result { @@ -2965,7 +2965,7 @@ template ::value)> FMT_INLINE auto format_to_n(OutputIt out, size_t n, format_string fmt, T&&... args) -> format_to_n_result { - return vformat_to_n(out, n, fmt, fmt::make_format_args(args...)); + return vformat_to_n(out, n, fmt, vargs{{args...}}); } struct format_to_result { @@ -3000,7 +3000,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, fmt, fmt::make_format_args(args...), {}); + detail::vformat_to(buf, fmt, vargs{{args...}}, {}); return buf.count(); } @@ -3019,7 +3019,7 @@ FMT_API void vprintln(FILE* f, string_view fmt, format_args args); */ template FMT_INLINE void print(format_string fmt, T&&... args) { - const auto& vargs = fmt::make_format_args(args...); + fmt::vargs vargs = {{args...}}; if (!FMT_USE_UTF8) return detail::vprint_mojibake(stdout, fmt, vargs, false); return detail::is_locking() ? vprint_buffered(stdout, fmt, vargs) : vprint(fmt, vargs); @@ -3035,7 +3035,7 @@ FMT_INLINE void print(format_string fmt, T&&... args) { */ template FMT_INLINE void print(FILE* f, format_string fmt, T&&... args) { - const auto& vargs = fmt::make_format_args(args...); + fmt::vargs vargs = {{args...}}; if (!FMT_USE_UTF8) return detail::vprint_mojibake(f, fmt, vargs, false); return detail::is_locking() ? vprint_buffered(f, fmt, vargs) : vprint(f, fmt, vargs); @@ -3045,7 +3045,7 @@ FMT_INLINE void print(FILE* f, format_string fmt, T&&... args) { /// to the file `f` followed by a newline. template FMT_INLINE void println(FILE* f, format_string fmt, T&&... args) { - const auto& vargs = fmt::make_format_args(args...); + fmt::vargs vargs = {{args...}}; return FMT_USE_UTF8 ? vprintln(f, fmt, vargs) : detail::vprint_mojibake(f, fmt, vargs, true); }