Skip to content

Commit

Permalink
Add missing const qualifier (#2755)
Browse files Browse the repository at this point in the history
  • Loading branch information
phprus authored Feb 10, 2022
1 parent ecd6022 commit c71b070
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions include/fmt/ranges.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ struct formatter<TupleT, Char, enable_if_t<fmt::is_tuple_like<TupleT>::value>> {
}

template <typename FormatContext = format_context>
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<FormatContext>{0, out});
Expand Down Expand Up @@ -385,7 +386,7 @@ struct formatter<
FMT_ENABLE_IF(
std::is_same<U, conditional_t<detail::has_const_begin_end<R>::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 = '}';
Expand Down Expand Up @@ -435,7 +436,7 @@ struct formatter<
FMT_ENABLE_IF(
std::is_same<U, conditional_t<detail::has_const_begin_end<T>::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;
Expand Down

0 comments on commit c71b070

Please sign in to comment.