From 02d15644088d2c75ca5052b4d1dfc9061e2d864e Mon Sep 17 00:00:00 2001 From: fghzxm Date: Mon, 17 Feb 2020 15:39:10 +0800 Subject: [PATCH] Fix FMT_FORMAT_AS const specifier position The current `FMT_FORMAT_AS` macro will make `formatter::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 &`. --- include/fmt/format.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index c9abfe48cdd7..09c9ac387b77 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2953,7 +2953,7 @@ struct formatter \ struct formatter : formatter { \ template \ - auto format(const Type& val, FormatContext& ctx) -> decltype(ctx.out()) { \ + auto format(Type const& val, FormatContext& ctx) -> decltype(ctx.out()) { \ return formatter::format(val, ctx); \ } \ }