diff --git a/include/fmt/core.h b/include/fmt/core.h index ece9ec45..98c5316c 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1003,13 +1003,14 @@ const uint64_t format_arg_store::TYPES = IS_PACKED ? \endrst */ template -inline format_arg_store make_args(const Args & ... args) { +inline format_arg_store + make_format_args(const Args & ... args) { return format_arg_store(args...); } template inline format_arg_store - make_args(const Args & ... args) { + make_format_args(const Args & ... args) { return format_arg_store(args...); } @@ -1165,7 +1166,7 @@ FMT_API void vprint_colored(color c, string_view format, format_args args); template inline void print_colored(color c, string_view format_str, const Args & ... args) { - vprint_colored(c, format_str, make_args(args...)); + vprint_colored(c, format_str, make_format_args(args...)); } format_context::iterator vformat_to( @@ -1210,7 +1211,7 @@ std::wstring vformat(wstring_view format_str, wformat_args args); template inline std::string format(string_view format_str, const Args & ... args) { // This should be just - // return vformat(format_str, make_args(args...)); + // return vformat(format_str, make_format_args(args...)); // but gcc has trouble optimizing the latter, so break it down. format_arg_store as(args...); return vformat(format_str, as); diff --git a/include/fmt/format.h b/include/fmt/format.h index 1c5a6c36..7da5d996 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2266,7 +2266,7 @@ class system_error : public std::runtime_error { template system_error(int error_code, string_view message, const Args & ... args) : std::runtime_error("") { - init(error_code, message, make_args(args...)); + init(error_code, message, make_format_args(args...)); } FMT_API ~system_error() FMT_DTOR_NOEXCEPT; @@ -2927,7 +2927,7 @@ class windows_error : public system_error { */ template windows_error(int error_code, string_view message, const Args & ... args) { - init(error_code, message, make_args(args...)); + init(error_code, message, make_format_args(args...)); } }; @@ -3383,13 +3383,13 @@ inline wformat_context::iterator vformat_to( template inline format_context::iterator format_to( memory_buffer &buf, string_view format_str, const Args & ... args) { - return vformat_to(buf, format_str, make_args(args...)); + return vformat_to(buf, format_str, make_format_args(args...)); } template inline wformat_context::iterator format_to( wmemory_buffer &buf, wstring_view format_str, const Args & ... args) { - return vformat_to(buf, format_str, make_args(args...)); + return vformat_to(buf, format_str, make_format_args(args...)); } template @@ -3414,7 +3414,7 @@ template inline OutputIt format_to(OutputIt out, string_view format_str, const Args & ... args) { return vformat_to(out, format_str, - *make_args::type>(args...)); + *make_format_args::type>(args...)); } template @@ -3422,7 +3422,7 @@ inline typename std::enable_if< is_contiguous::value, std::back_insert_iterator>::type format_to(std::back_insert_iterator out, string_view format_str, const Args & ... args) { - return vformat_to(out, format_str, make_args(args...)); + return vformat_to(out, format_str, make_format_args(args...)); } template @@ -3445,7 +3445,7 @@ inline format_to_n_result format_to_n( OutputIt out, std::size_t n, string_view format_str, const Args & ... args) { typedef internal::truncating_iterator It; auto it = vformat_to(It(out, n), format_str, - *make_args::type>(args...)); + *make_format_args::type>(args...)); return {it.base(), it.count()}; } @@ -3466,14 +3466,14 @@ inline typename std::enable_if< internal::is_format_string::value, std::string>::type format(String format_str, const Args & ... args) { internal::check_format_string(format_str); - return vformat(format_str.data(), make_args(args...)); + return vformat(format_str.data(), make_format_args(args...)); } template inline typename std::enable_if::value>::type print(String format_str, const Args & ... args) { internal::check_format_string(format_str); - return vprint(format_str.data(), make_args(args...)); + return vprint(format_str.data(), make_format_args(args...)); } // Counts the number of characters in the output of format(format_str, args...). diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index 3ac5cd65..42455559 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -139,7 +139,7 @@ inline void vprint(std::ostream &os, string_view format_str, format_args args) { template inline void print(std::ostream &os, string_view format_str, const Args & ... args) { - vprint(os, format_str, make_args(args...)); + vprint(os, format_str, make_format_args(args...)); } } // namespace fmt diff --git a/include/fmt/posix.h b/include/fmt/posix.h index 30f7b904..d01b80fd 100644 --- a/include/fmt/posix.h +++ b/include/fmt/posix.h @@ -218,7 +218,7 @@ public: template inline void print(string_view format_str, const Args & ... args) { - vprint(format_str, make_args(args...)); + vprint(format_str, make_format_args(args...)); } }; diff --git a/include/fmt/printf.h b/include/fmt/printf.h index 9e605b0a..20f79de1 100644 --- a/include/fmt/printf.h +++ b/include/fmt/printf.h @@ -570,7 +570,7 @@ inline std::string vsprintf(string_view format, printf_args args) { template inline std::string sprintf(string_view format_str, const Args & ... args) { return vsprintf(format_str, - make_args::type>(args...)); + make_format_args::type>(args...)); } inline std::wstring vsprintf( @@ -583,7 +583,7 @@ inline std::wstring vsprintf( template inline std::wstring sprintf(wstring_view format_str, const Args & ... args) { - auto vargs = make_args< + auto vargs = make_format_args< typename printf_context::type>(args...); return vsprintf(format_str, vargs); } @@ -607,7 +607,7 @@ inline int vfprintf(std::FILE *f, string_view format, printf_args args) { */ template inline int fprintf(std::FILE *f, string_view format_str, const Args & ... args) { - auto vargs = make_args< + auto vargs = make_format_args< typename printf_context::type>(args...); return vfprintf(f, format_str, vargs); } @@ -628,7 +628,7 @@ inline int vprintf(string_view format, printf_args args) { template inline int printf(string_view format_str, const Args & ... args) { return vprintf(format_str, - make_args::type>(args...)); + make_format_args::type>(args...)); } inline int vfprintf(std::ostream &os, string_view format_str, @@ -651,7 +651,7 @@ inline int vfprintf(std::ostream &os, string_view format_str, template inline int fprintf(std::ostream &os, string_view format_str, const Args & ... args) { - auto vargs = make_args< + auto vargs = make_format_args< typename printf_context::type>(args...); return vfprintf(os, format_str, vargs); } diff --git a/test/custom-formatter-test.cc b/test/custom-formatter-test.cc index 610ef7c0..dd513a59 100644 --- a/test/custom-formatter-test.cc +++ b/test/custom-formatter-test.cc @@ -37,7 +37,7 @@ std::string custom_vformat(fmt::string_view format_str, fmt::format_args args) { template std::string custom_format(const char *format_str, const Args & ... args) { - auto va = fmt::make_args(args...); + auto va = fmt::make_format_args(args...); return custom_vformat(format_str, va); } diff --git a/test/format-test.cc b/test/format-test.cc index 9bb40c8f..c139d260 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1324,7 +1324,7 @@ std::string vformat_message(int id, const char *format, fmt::format_args args) { template std::string format_message(int id, const char *format, const Args & ... args) { - auto va = fmt::make_args(args...); + auto va = fmt::make_format_args(args...); return vformat_message(id, format, va); } @@ -1433,7 +1433,7 @@ void custom_vformat(fmt::string_view format_str, fmt::format_args args) { template void custom_format(const char *format_str, const Args & ... args) { - auto va = fmt::make_args(args...); + auto va = fmt::make_format_args(args...); return custom_vformat(format_str, va); }