From 3dbbd613c24c1192621e5b4ebe1d7e58fe91c668 Mon Sep 17 00:00:00 2001 From: jl Date: Sat, 17 Oct 2020 22:51:22 +0200 Subject: [PATCH] Support std::ostream formatter in ranges --- include/fmt/ranges.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index b603d637..3bc309e0 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -330,7 +330,10 @@ struct formatter, Char> { typename FormatContext::iterator format_args( const tuple_arg_join& value, FormatContext& ctx, const Arg& arg, const Args&... args) { - using base = formatter::type, Char>; + + using arg_type = typename std::decay::type; + using base = conditional_t::value, formatter, detail::fallback_formatter>; + auto out = ctx.out(); out = base{}.format(arg, ctx); if (sizeof...(Args) > 0) {