diff --git a/test/format b/test/format index 3ba38f49..8b9e5b92 100644 --- a/test/format +++ b/test/format @@ -488,24 +488,21 @@ template namespace std { namespace detail { -template +template class arg_formatter - : public fmt::internal::arg_formatter_base< - typename Range::iterator, typename Range::value_type, error_handler> { + : public fmt::internal::arg_formatter_base { private: - using char_type = typename Range::value_type; - using base = fmt::internal::arg_formatter_base< - typename Range::iterator, char_type, error_handler>; - using format_context = std::basic_format_context; - using parse_context = basic_format_parse_context; + using char_type = Char; + using base = fmt::internal::arg_formatter_base; + using format_context = std::basic_format_context; + using parse_context = basic_format_parse_context; parse_context* parse_ctx_; format_context& ctx_; public: - typedef Range range; - typedef typename base::iterator iterator; - typedef typename base::format_specs format_specs; + using iterator = OutputIt; + using format_specs = typename base::format_specs; /** \rst @@ -584,12 +581,12 @@ class custom_formatter { template struct format_handler : detail::error_handler { - typedef typename ArgFormatter::range range; + using iterator = typename ArgFormatter::iterator; - format_handler(range r, basic_string_view str, + format_handler(iterator out, basic_string_view str, basic_format_args format_args, fmt::internal::locale_ref loc) - : parse_ctx(str), context(r.begin(), format_args, loc) {} + : parse_ctx(str), context(out, format_args, loc) {} void on_text(const Char* begin, const Char* end) { auto size = fmt::internal::to_unsigned(end - begin); @@ -694,9 +691,9 @@ struct formatter { specs_.width, specs_.width_ref, ctx); fmt::internal::handle_dynamic_spec( specs_.precision, specs_.precision_ref, ctx); - using range_type = fmt::internal::output_range; - return visit_format_arg(arg_formatter(ctx, nullptr, &specs_), + using af = arg_formatter; + return visit_format_arg(af(ctx, nullptr, &specs_), basic_format_arg(val)); } @@ -719,9 +716,9 @@ template string vformat(string_view fmt, format_args args) { fmt::memory_buffer mbuf; fmt::internal::buffer& buf = mbuf; - using range = fmt::buffer_range; - detail::format_handler, char, format_context> - h(range(std::back_inserter(buf)), fmt, args, {}); + using af = detail::arg_formatter; + detail::format_handler + h(std::back_inserter(buf), fmt, args, {}); fmt::internal::parse_format_string(fmt::to_string_view(fmt), h); return to_string(mbuf); } @@ -742,9 +739,9 @@ template template Out vformat_to(Out out, string_view fmt, format_args_t, char> args) { - using range = fmt::internal::output_range; - detail::format_handler, char, basic_format_context> - h(range(out), fmt, args, {}); + using af = detail::arg_formatter; + detail::format_handler> + h(out, fmt, args, {}); fmt::internal::parse_format_string(fmt::to_string_view(fmt), h); return h.context.out(); } diff --git a/test/format-test.cc b/test/format-test.cc index b8e56ee2..0b94a8d9 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1806,10 +1806,10 @@ TEST(FormatTest, StrongEnum) { } #endif -using buffer_range = fmt::buffer_range; +using buffer_iterator = fmt::format_context::iterator; class mock_arg_formatter - : public fmt::detail::arg_formatter_base { + : public fmt::detail::arg_formatter_base { private: #if FMT_USE_INT128 MOCK_METHOD1(call, void(__int128_t value)); @@ -1818,8 +1818,7 @@ class mock_arg_formatter #endif public: - typedef fmt::detail::arg_formatter_base base; - typedef buffer_range range; + using base = fmt::detail::arg_formatter_base; mock_arg_formatter(fmt::format_context& ctx, fmt::format_parse_context*, fmt::format_specs* s = nullptr)