mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-02 11:28:20 +00:00
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:
parent
e00997b004
commit
2161a73f2b
@ -2953,7 +2953,7 @@ struct formatter<T, Char,
|
|||||||
template <typename Char> \
|
template <typename Char> \
|
||||||
struct formatter<Type, Char> : formatter<Base, Char> { \
|
struct formatter<Type, Char> : formatter<Base, Char> { \
|
||||||
template <typename FormatContext> \
|
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); \
|
return formatter<Base, Char>::format(val, ctx); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user