mirror of
https://github.com/fmtlib/fmt.git
synced 2025-03-16 01:21:23 +00:00
Simplify formatters
This commit is contained in:
parent
0b8404918e
commit
6369af37d3
@ -4088,22 +4088,10 @@ struct formatter<T, Char, enable_if_t<detail::has_format_as<T>::value>>
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Char>
|
FMT_FORMAT_AS(void*, const void*);
|
||||||
struct formatter<void*, Char> : formatter<const void*, Char> {
|
|
||||||
template <typename FormatContext>
|
|
||||||
auto format(void* val, FormatContext& ctx) const -> decltype(ctx.out()) {
|
|
||||||
return formatter<const void*, Char>::format(val, ctx);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename Char, size_t N>
|
template <typename Char, size_t N>
|
||||||
struct formatter<Char[N], Char> : formatter<basic_string_view<Char>, Char> {
|
struct formatter<Char[N], Char> : formatter<basic_string_view<Char>, Char> {};
|
||||||
template <typename FormatContext>
|
|
||||||
FMT_CONSTEXPR auto format(const Char* val, FormatContext& ctx) const
|
|
||||||
-> decltype(ctx.out()) {
|
|
||||||
return formatter<basic_string_view<Char>, Char>::format(val, ctx);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\rst
|
\rst
|
||||||
|
Loading…
x
Reference in New Issue
Block a user