diff --git a/include/fmt/core.h b/include/fmt/core.h index 2a0b1f58..ac50a7d4 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1307,12 +1307,10 @@ std::basic_string vformat( basic_format_args::type> args); } // namespace internal -#define FMT_CHAR(Str) typename internal::format_string_traits::char_type - template format_context::iterator vformat_to( - internal::basic_buffer &buf, const String &format_str, - basic_format_args > args); + internal::basic_buffer &buf, const String &format_str, + basic_format_args > args); template struct is_contiguous : std::false_type {}; @@ -1351,13 +1349,13 @@ inline typename std::enable_if< format_to(std::back_insert_iterator out, const String &format_str, const Args &... args) { internal::check_format_string(format_str); - typedef typename buffer_context< FMT_CHAR(String) >::type context_t; + typedef typename buffer_context< FMT_CHAR(String)>::type context_t; format_arg_store as{args...}; - return vformat_to(out, basic_string_view< FMT_CHAR(String) >(format_str), + return vformat_to(out, basic_string_view< FMT_CHAR(String)>(format_str), basic_format_args(as)); } -template +template inline std::basic_string vformat( const String &format_str, basic_format_args::type> args) { @@ -1376,15 +1374,15 @@ inline std::basic_string vformat( \endrst */ template -inline std::basic_string< FMT_CHAR(String) > format( +inline std::basic_string< FMT_CHAR(String)> format( const String &format_str, const Args &... args) { internal::check_format_string(format_str); // This should be just // return vformat(format_str, make_format_args(args...)); // but gcc has trouble optimizing the latter, so break it down. - typedef typename buffer_context< FMT_CHAR(String) >::type context_t; + typedef typename buffer_context< FMT_CHAR(String)>::type context_t; format_arg_store as{args...}; - return internal::vformat(basic_string_view< FMT_CHAR(String) >(format_str), + return internal::vformat(basic_string_view(format_str), basic_format_args(as)); } @@ -1407,9 +1405,9 @@ template inline typename std::enable_if::value>::type print(std::FILE *f, const String &format_str, const Args &... args) { internal::check_format_string(format_str); - typedef typename buffer_context< FMT_CHAR(String) >::type context_t; + typedef typename buffer_context< FMT_CHAR(String)>::type context_t; format_arg_store as{ args... }; - vprint(f, basic_string_view< FMT_CHAR(String) >(format_str), + vprint(f, basic_string_view< FMT_CHAR(String)>(format_str), basic_format_args(as)); } @@ -1429,9 +1427,9 @@ template inline typename std::enable_if::value>::type print(const String &format_str, const Args &... args) { internal::check_format_string(format_str); - typedef typename buffer_context< FMT_CHAR(String) >::type context_t; + typedef typename buffer_context::type context_t; format_arg_store as{ args... }; - vprint(basic_string_view< FMT_CHAR(String) >(format_str), + vprint(basic_string_view(format_str), basic_format_args(as)); } FMT_END_NAMESPACE diff --git a/include/fmt/format.h b/include/fmt/format.h index 5e47b346..2919daa4 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3442,10 +3442,10 @@ std::basic_string to_string(const basic_memory_buffer &buf) { } template -inline typename buffer_context::type::iterator vformat_to( +inline typename buffer_context::type::iterator vformat_to( internal::basic_buffer &buf, const String &format_str, basic_format_args::type> args) { - typedef back_insert_range > range; + typedef back_insert_range > range; return vformat_to>( buf, basic_string_view(format_str), args); } @@ -3483,8 +3483,8 @@ struct format_args_t { template inline OutputIt vformat_to( OutputIt out, const String &format_str, - typename format_args_t::type args) { - typedef output_range range; + typename format_args_t::type args) { + typedef output_range range; return vformat_to>(range(out), format_str, args); } @@ -3504,9 +3504,9 @@ inline typename std::enable_if< internal::is_format_string::value, OutputIt>::type format_to(OutputIt out, const String &format_str, const Args &... args) { internal::check_format_string(format_str); - typedef typename format_context_t::type context; + typedef typename format_context_t::type context; format_arg_store as{args...}; - return vformat_to(out, basic_string_view< FMT_CHAR(String) >(format_str), + return vformat_to(out, basic_string_view(format_str), basic_format_args(as)); }