This commit is contained in:
sunmy 2021-06-09 06:46:14 +08:00
parent 12aacc2836
commit c6f8112a06

View File

@ -451,10 +451,10 @@ FMT_END_DETAIL_NAMESPACE
template <typename Char, typename Duration>
struct formatter<std::chrono::time_point<std::chrono::system_clock, Duration>,
Char> : formatter<std::tm, Char> {
FMT_CONSTEXPR FMT_INLINE void generate_defalut_spec(char) {
FMT_CONSTEXPR FMT_INLINE void generate_default_spec(char) {
this->specs = {"%Y-%m-%d %H:%M:%S", 17};
}
FMT_CONSTEXPR FMT_INLINE void generate_defalut_spec(wchar_t) {
FMT_CONSTEXPR FMT_INLINE void generate_default_spec(wchar_t) {
this->specs = {L"%Y-%m-%d %H:%M:%S", 17};
}
@ -465,7 +465,7 @@ struct formatter<std::chrono::time_point<std::chrono::system_clock, Duration>,
auto end = it;
while (end != ctx.end() && *end != '}') ++end;
if (end == it) {
generate_defalut_spec(typename ParseContext::char_type{});
generate_default_spec(typename ParseContext::char_type{});
} else {
this->specs = {it, detail::to_unsigned(end - it)};
}