diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index 9fdfabc0c1b3..2de95610756d 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -304,7 +304,8 @@ struct formatter::value>> { } template - auto format(const TupleT& values, FormatContext& ctx) -> decltype(ctx.out()) { + auto format(const TupleT& values, FormatContext& ctx) const + -> decltype(ctx.out()) { auto out = ctx.out(); *out++ = '('; detail::for_each(values, format_each{0, out}); @@ -385,7 +386,7 @@ struct formatter< FMT_ENABLE_IF( std::is_same::value, const R, R>>::value)> - auto format(U& range, FormatContext& ctx) -> decltype(ctx.out()) { + auto format(U& range, FormatContext& ctx) const -> decltype(ctx.out()) { #ifdef FMT_DEPRECATED_BRACED_RANGES Char prefix = '{'; Char postfix = '}'; @@ -435,7 +436,7 @@ struct formatter< FMT_ENABLE_IF( std::is_same::value, const T, T>>::value)> - auto format(U& map, FormatContext& ctx) -> decltype(ctx.out()) { + auto format(U& map, FormatContext& ctx) const -> decltype(ctx.out()) { auto out = ctx.out(); *out++ = '{'; int i = 0;