fix #2118: FMT_COMPILE did not work with tm formatter (#2119)

Co-authored-by: summivox <summivox@github.com>
This commit is contained in:
Yin Zhong 2021-01-30 08:44:49 -08:00 committed by GitHub
parent 2a25e2bf4d
commit 1980ca8c4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -423,7 +423,8 @@ template <typename Char> struct formatter<std::tm, Char> {
}
template <typename FormatContext>
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<Char> tm_format;
tm_format.append(specs.begin(), specs.end());
tm_format.push_back('\0');