From 1980ca8c4e40d5323e3ac05ebc53457283ef4895 Mon Sep 17 00:00:00 2001 From: Yin Zhong Date: Sat, 30 Jan 2021 08:44:49 -0800 Subject: [PATCH] fix #2118: FMT_COMPILE did not work with tm formatter (#2119) Co-authored-by: summivox --- include/fmt/chrono.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index d68e8148..4b9aeeb1 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -423,7 +423,8 @@ template struct formatter { } template - auto format(const std::tm& tm, FormatContext& ctx) -> decltype(ctx.out()) { + auto format(const std::tm& tm, FormatContext& ctx) const + -> decltype(ctx.out()) { basic_memory_buffer tm_format; tm_format.append(specs.begin(), specs.end()); tm_format.push_back('\0');