mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-08 03:43:13 +00:00
Simplify FMT_FORMAT_AS
This commit is contained in:
parent
7401fe046a
commit
de8d0171a2
@ -2692,13 +2692,7 @@ struct formatter<T, Char,
|
|||||||
|
|
||||||
#define FMT_FORMAT_AS(Type, Base) \
|
#define FMT_FORMAT_AS(Type, Base) \
|
||||||
template <typename Char> \
|
template <typename Char> \
|
||||||
struct formatter<Type, Char> : formatter<Base, Char> { \
|
struct formatter<Type, Char> : formatter<Base, Char> {}
|
||||||
template <typename FormatContext> \
|
|
||||||
auto format(Type const& val, FormatContext& ctx) const \
|
|
||||||
-> decltype(ctx.out()) { \
|
|
||||||
return formatter<Base, Char>::format(static_cast<Base>(val), ctx); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
FMT_FORMAT_AS(signed char, int);
|
FMT_FORMAT_AS(signed char, int);
|
||||||
FMT_FORMAT_AS(unsigned char, unsigned);
|
FMT_FORMAT_AS(unsigned char, unsigned);
|
||||||
|
Loading…
Reference in New Issue
Block a user