gcc 4.8 interprets inaccessible as a hard error (instead of... not available)

This commit is contained in:
Barry Revzin 2022-07-15 21:22:41 -05:00
parent ec6811c3c9
commit ec540969f4

View File

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