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<<.
template <typename Char>
struct basic_ostream_formatter
: private formatter<basic_string_view<Char>, Char> {
using basic_ostream_formatter::formatter::parse;
struct basic_ostream_formatter {
private:
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>
auto format(const T& value, basic_format_context<OutputIt, Char>& ctx) const
-> OutputIt {
auto buffer = basic_memory_buffer<Char>();
format_value(buffer, value, ctx.locale());
return formatter<basic_string_view<Char>, Char>::format(
{buffer.data(), buffer.size()}, ctx);
return underlying_.format({buffer.data(), buffer.size()}, ctx);
}
};