From ec540969f41a933d93af28752cd22736333e90db Mon Sep 17 00:00:00 2001 From: Barry Revzin Date: Fri, 15 Jul 2022 21:22:41 -0500 Subject: [PATCH] gcc 4.8 interprets inaccessible as a hard error (instead of... not available) --- include/fmt/ostream.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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); } };