diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index 0cbb9996..cff8b03e 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -129,17 +129,22 @@ template struct streamed_view { const T& value; }; // Formats an object of type T that has an overloaded ostream operator<<. template -struct basic_ostream_formatter - : private formatter, Char> { - using basic_ostream_formatter::formatter::parse; +struct basic_ostream_formatter { +private: + formatter, Char> underlying_; + +public: + template + FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { + return underlying_.parse(ctx); + } template auto format(const T& value, basic_format_context& ctx) const -> OutputIt { auto buffer = basic_memory_buffer(); format_value(buffer, value, ctx.locale()); - return formatter, Char>::format( - {buffer.data(), buffer.size()}, ctx); + return underlying_.format({buffer.data(), buffer.size()}, ctx); } };