Fix FMT_FORMAT_AS const specifier position (#1554)

The current `FMT_FORMAT_AS` macro will make `formatter<Char *>::format`
have the first argument type `const Char *&` which is incorrect an
should be `Char *const &`.  This pull request fixes that by changing the
first argument type in the macro definition body from `const Type &` to
`Type const &`.
This commit is contained in:
fghzxm 2020-02-23 23:27:22 +08:00 committed by GitHub
parent e00997b004
commit 2161a73f2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2953,7 +2953,7 @@ struct formatter<T, Char,
template <typename Char> \
struct formatter<Type, Char> : formatter<Base, Char> { \
template <typename FormatContext> \
auto format(const Type& val, FormatContext& ctx) -> decltype(ctx.out()) { \
auto format(Type const& val, FormatContext& ctx) -> decltype(ctx.out()) { \
return formatter<Base, Char>::format(val, ctx); \
} \
}