diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index 5ec80d72..c8ab9143 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -686,10 +686,10 @@ struct formatter - auto format(const T& t, FormatContext& ctx) const -> + auto format(T& t, FormatContext& ctx) const -> typename FormatContext::iterator { struct getter : T { - static auto get(const T& t) -> decltype(t.*(&getter::c)) { + static auto get(T& t) -> typename T::container_type& { return t.*(&getter::c); // Access c through the derived class. } };