diff --git a/include/fmt/base.h b/include/fmt/base.h index ad486c9b..e1226670 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -1879,11 +1879,11 @@ using basic_format_context = using format_context = context; template -using buffer_context = basic_format_context, Char>; +using buffered_context = basic_format_context, Char>; template using is_formattable = bool_constant>() + detail::unformattable, decltype(detail::arg_mapper>() .map(std::declval()))>::value>; /** @@ -2518,7 +2518,7 @@ template FMT_CONSTEXPR auto parse_format_specs(ParseContext& ctx) -> decltype(ctx.begin()) { using char_type = typename ParseContext::char_type; - using context = buffer_context; + using context = buffered_context; using mapped_type = conditional_t< mapped_type_constant::value != type::custom_type, decltype(arg_mapper().map(std::declval())), @@ -2589,7 +2589,7 @@ template class format_string_checker { public: explicit FMT_CONSTEXPR format_string_checker(basic_string_view fmt) - : types_{mapped_type_constant>::value...}, + : types_{mapped_type_constant>::value...}, context_(fmt, num_args, types_), parse_funcs_{&parse_format_specs...} {} @@ -2652,16 +2652,15 @@ void check_format_string(S format_str) { ignore_unused(error); } +// Use vformat_args and avoid type_identity to keep symbols short and workaround +// a GCC <= 4.8 bug. template struct vformat_args { - using type = - basic_format_args, Char>>; + using type = basic_format_args>; }; template <> struct vformat_args { using type = format_args; }; -// Use vformat_args and avoid type_identity, keep symbols short and workaround -// a GCC <= 4.8 bug. template void vformat_to(buffer& buf, basic_string_view fmt, typename vformat_args::type args, locale_ref loc = {}); diff --git a/include/fmt/color.h b/include/fmt/color.h index ed697a57..753e61f8 100644 --- a/include/fmt/color.h +++ b/include/fmt/color.h @@ -441,9 +441,9 @@ template struct styled_arg : detail::view { }; template -void vformat_to(buffer& buf, const text_style& ts, - basic_string_view format_str, - basic_format_args>> args) { +void vformat_to( + buffer& buf, const text_style& ts, basic_string_view format_str, + basic_format_args>> args) { bool has_style = false; if (ts.has_emphasis()) { has_style = true; diff --git a/include/fmt/format.h b/include/fmt/format.h index e53aa350..b6c5a1b8 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3843,7 +3843,7 @@ FMT_CONSTEXPR auto write(OutputIt out, const T& value) // iterator. It's a class and not a generic lambda for compatibility with C++11. template struct default_arg_formatter { using iterator = basic_appender; - using context = buffer_context; + using context = buffered_context; iterator out; basic_format_args args; @@ -3862,7 +3862,7 @@ template struct default_arg_formatter { template struct arg_formatter { using iterator = basic_appender; - using context = buffer_context; + using context = buffered_context; iterator out; const format_specs& specs; @@ -4362,10 +4362,10 @@ void vformat_to(buffer& buf, basic_string_view fmt, struct format_handler { basic_format_parse_context parse_context; - buffer_context context; + buffered_context context; format_handler(basic_appender p_out, basic_string_view str, - basic_format_args> p_args, + basic_format_args> p_args, locale_ref p_loc) : parse_context(str), context(p_out, p_args, p_loc) {} diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index 389949e7..2508e58d 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -223,7 +223,7 @@ template void print(std::wostream& os, basic_format_string...> fmt, Args&&... args) { - vprint(os, fmt, fmt::make_format_args>(args...)); + vprint(os, fmt, fmt::make_format_args>(args...)); } FMT_EXPORT template diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index 8f8971c3..c0acfa77 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -384,8 +384,8 @@ template struct range_mapper { template using range_formatter_type = - formatter>{}.map( - std::declval()))>, + formatter>{} + .map(std::declval()))>, Char>; template @@ -462,7 +462,7 @@ struct range_formatter< template auto format(R&& range, FormatContext& ctx) const -> decltype(ctx.out()) { - detail::range_mapper> mapper; + detail::range_mapper> mapper; auto out = ctx.out(); out = detail::copy_str(opening_bracket_, out); int i = 0; diff --git a/include/fmt/xchar.h b/include/fmt/xchar.h index 68e81659..4a048fbd 100644 --- a/include/fmt/xchar.h +++ b/include/fmt/xchar.h @@ -65,7 +65,7 @@ FMT_BEGIN_EXPORT using wstring_view = basic_string_view; using wformat_parse_context = basic_format_parse_context; -using wformat_context = buffer_context; +using wformat_context = buffered_context; using wformat_args = basic_format_args; using wmemory_buffer = basic_memory_buffer; @@ -148,7 +148,7 @@ template ::value)> auto format(const S& format_str, T&&... args) -> std::basic_string { return vformat(detail::to_string_view(format_str), - fmt::make_format_args>(args...)); + fmt::make_format_args>(args...)); } template std::basic_string { return detail::vformat(loc, detail::to_string_view(format_str), - fmt::make_format_args>(args...)); + fmt::make_format_args>(args...)); } template ::value)> inline auto format_to(OutputIt out, const S& fmt, T&&... args) -> OutputIt { return vformat_to(out, detail::to_string_view(fmt), - fmt::make_format_args>(args...)); + fmt::make_format_args>(args...)); } template typename std::enable_if::type { return vformat_to(out, loc, detail::to_string_view(format_str), - fmt::make_format_args>(args...)); + fmt::make_format_args>(args...)); } template format_to_n_result { return vformat_to_n(out, n, fmt::basic_string_view(fmt), - fmt::make_format_args>(args...)); + fmt::make_format_args>(args...)); } template size_t { auto buf = detail::counting_buffer(); detail::vformat_to(buf, detail::to_string_view(fmt), - fmt::make_format_args>(args...)); + fmt::make_format_args>(args...)); return buf.count(); }