Skip to content
forked from fmtlib/fmt

Commit

Permalink
Fix FMT_FORMAT_AS const specifier position (fmtlib#1554)
Browse files Browse the repository at this point in the history
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 &`.
  • Loading branch information
fghzxm authored Feb 23, 2020
1 parent e00997b commit 2161a73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
} \
}
Expand Down

0 comments on commit 2161a73

Please sign in to comment.