Simplify format_handler

This commit is contained in:
Victor Zverovich 2019-10-30 07:02:38 -07:00
parent 58c6f8c7f5
commit 8e700619b7

View File

@ -2663,7 +2663,7 @@ class arg_formatter : public internal::arg_formatter_base<Range> {
/** Formats an argument of a user-defined type. */ /** Formats an argument of a user-defined type. */
iterator operator()(typename basic_format_arg<context_type>::handle handle) { iterator operator()(typename basic_format_arg<context_type>::handle handle) {
handle.format(*parse_ctx_, ctx_); handle.format(*parse_ctx_, ctx_);
return this->out(); return ctx_.out();
} }
}; };
@ -3207,10 +3207,8 @@ struct format_handler : internal::error_handler {
void on_replacement_field(const Char* p) { void on_replacement_field(const Char* p) {
advance_to(parse_context, p); advance_to(parse_context, p);
internal::custom_formatter<Context> f(parse_context, context); context.advance_to(
if (!visit_format_arg(f, arg)) visit_format_arg(ArgFormatter(context, &parse_context), arg));
context.advance_to(
visit_format_arg(ArgFormatter(context, &parse_context), arg));
} }
const Char* on_format_specs(const Char* begin, const Char* end) { const Char* on_format_specs(const Char* begin, const Char* end) {