diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index ea702f58..cf03c03b 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -406,6 +406,23 @@ struct range_formatter< detail::string_literal{}; bool is_debug = false; + template ::value)> + auto write_debug_string(Output& out, It it, Sentinel end) const -> Output { + auto buf = basic_memory_buffer(); + for (; it != end; ++it) buf.push_back(*it); + auto specs = format_specs(); + specs.type = presentation_type::debug; + return detail::write( + out, basic_string_view(buf.data(), buf.size()), specs); + } + + template ::value)> + auto write_debug_string(Output& out, It, Sentinel) const -> Output { + return out; + } + public: FMT_CONSTEXPR range_formatter() {} @@ -464,22 +481,6 @@ struct range_formatter< return underlying_.parse(ctx); } - template ::value)> - auto write_debug_string(Output& out, It it, Sentinel end) const -> Output { - auto buf = basic_memory_buffer(); - for (; it != end; ++it) buf.push_back(*it); - auto specs = format_specs(); - specs.type = presentation_type::debug; - return detail::write( - out, basic_string_view(buf.data(), buf.size()), specs); - } - template ::value)> - auto write_debug_string(Output& out, It, Sentinel) const -> Output { - return out; - } - template auto format(R&& range, FormatContext& ctx) const -> decltype(ctx.out()) { detail::range_mapper> mapper;