From 1f110702a1c24c836b2a2a15f7c959d22582a704 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 15 Jan 2020 11:42:59 -0800 Subject: [PATCH] Remove redundant braces --- include/fmt/color.h | 4 ++-- include/fmt/core.h | 20 +++++++++++--------- include/fmt/format.h | 4 ++-- include/fmt/locale.h | 19 ++++++++++--------- include/fmt/ostream.h | 4 ++-- 5 files changed, 27 insertions(+), 24 deletions(-) diff --git a/include/fmt/color.h b/include/fmt/color.h index f101c892..3756ba3f 100644 --- a/include/fmt/color.h +++ b/include/fmt/color.h @@ -538,7 +538,7 @@ void print(const text_style& ts, const S& format_str, const Args&... args) { template > inline std::basic_string vformat( const text_style& ts, const S& format_str, - basic_format_args> args) { + basic_format_args>> args) { basic_memory_buffer buf; internal::vformat_to(buf, ts, to_string_view(format_str), args); return fmt::to_string(buf); @@ -560,7 +560,7 @@ template > inline std::basic_string format(const text_style& ts, const S& format_str, const Args&... args) { return vformat(ts, to_string_view(format_str), - {internal::make_args_checked(format_str, args...)}); + internal::make_args_checked(format_str, args...)); } FMT_END_NAMESPACE diff --git a/include/fmt/core.h b/include/fmt/core.h index 4a777f75..00e2c3a3 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1448,8 +1448,9 @@ make_args_checked(const S& format_str, } template -std::basic_string vformat(basic_string_view format_str, - basic_format_args> args); +std::basic_string vformat( + basic_string_view format_str, + basic_format_args>> args); template typename buffer_context::iterator vformat_to( @@ -1485,8 +1486,9 @@ void arg(S, internal::named_arg) = delete; template , FMT_ENABLE_IF( internal::is_contiguous_back_insert_iterator::value)> -OutputIt vformat_to(OutputIt out, const S& format_str, - basic_format_args> args) { +OutputIt vformat_to( + OutputIt out, const S& format_str, + basic_format_args>> args) { using container = remove_reference_t; internal::container_buffer buf((internal::get_container(out))); internal::vformat_to(buf, to_string_view(format_str), args); @@ -1499,14 +1501,14 @@ template format_to( std::back_insert_iterator out, const S& format_str, Args&&... args) { - return vformat_to( - out, to_string_view(format_str), - {internal::make_args_checked(format_str, args...)}); + return vformat_to(out, to_string_view(format_str), + internal::make_args_checked(format_str, args...)); } template > inline std::basic_string vformat( - const S& format_str, basic_format_args> args) { + const S& format_str, + basic_format_args>> args) { return internal::vformat(to_string_view(format_str), args); } @@ -1526,7 +1528,7 @@ template > inline std::basic_string format(const S& format_str, Args&&... args) { return internal::vformat( to_string_view(format_str), - {internal::make_args_checked(format_str, args...)}); + internal::make_args_checked(format_str, args...)); } FMT_API void vprint(string_view, format_args); diff --git a/include/fmt/format.h b/include/fmt/format.h index 7552a1b5..b6a26f3b 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3249,7 +3249,7 @@ inline typename buffer_context::iterator format_to( internal::check_format_string(format_str); using context = buffer_context; return internal::vformat_to(buf, to_string_view(format_str), - {make_format_args(args...)}); + make_format_args(args...)); } template @@ -3346,7 +3346,7 @@ inline format_to_n_result format_to_n(OutputIt out, std::size_t n, template inline std::basic_string internal::vformat( basic_string_view format_str, - basic_format_args> args) { + basic_format_args>> args) { basic_memory_buffer buffer; internal::vformat_to(buffer, format_str, args); return to_string(buffer); diff --git a/include/fmt/locale.h b/include/fmt/locale.h index 7c13656e..70bc1935 100644 --- a/include/fmt/locale.h +++ b/include/fmt/locale.h @@ -9,6 +9,7 @@ #define FMT_LOCALE_H_ #include + #include "format.h" FMT_BEGIN_NAMESPACE @@ -18,16 +19,16 @@ template typename buffer_context::iterator vformat_to( const std::locale& loc, buffer& buf, basic_string_view format_str, - basic_format_args> args) { + basic_format_args>> args) { using range = buffer_range; return vformat_to>(buf, to_string_view(format_str), args, internal::locale_ref(loc)); } template -std::basic_string vformat(const std::locale& loc, - basic_string_view format_str, - basic_format_args> args) { +std::basic_string vformat( + const std::locale& loc, basic_string_view format_str, + basic_format_args>> args) { basic_memory_buffer buffer; internal::vformat_to(loc, buffer, format_str, args); return fmt::to_string(buffer); @@ -37,7 +38,7 @@ std::basic_string vformat(const std::locale& loc, template > inline std::basic_string vformat( const std::locale& loc, const S& format_str, - basic_format_args> args) { + basic_format_args>> args) { return internal::vformat(loc, to_string_view(format_str), args); } @@ -46,15 +47,15 @@ inline std::basic_string format(const std::locale& loc, const S& format_str, Args&&... args) { return internal::vformat( loc, to_string_view(format_str), - {internal::make_args_checked(format_str, args...)}); + internal::make_args_checked(format_str, args...)); } template ::value, char_t>> -inline OutputIt vformat_to(OutputIt out, const std::locale& loc, - const S& format_str, - format_args_t args) { +inline OutputIt vformat_to( + OutputIt out, const std::locale& loc, const S& format_str, + format_args_t, Char> args) { using range = internal::output_range; return vformat_to>( range(out), to_string_view(format_str), args, internal::locale_ref(loc)); diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index 72d078b2..75a8cd4b 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -115,7 +115,7 @@ struct fallback_formatter::value>> template void vprint(std::basic_ostream& os, basic_string_view format_str, - basic_format_args> args) { + basic_format_args>> args) { basic_memory_buffer buffer; internal::vformat_to(buffer, format_str, args); internal::write(os, buffer); @@ -134,7 +134,7 @@ template ::value, char_t>> void print(std::basic_ostream& os, const S& format_str, Args&&... args) { vprint(os, to_string_view(format_str), - {internal::make_args_checked(format_str, args...)}); + internal::make_args_checked(format_str, args...)); } FMT_END_NAMESPACE