Add support for time points with arbitrary durations (#2208)

This commit is contained in:
Victor Zverovich
2021-04-02 11:17:14 -07:00
parent dac42f52b2
commit 06b3a1000c
2 changed files with 20 additions and 14 deletions

View File

@@ -401,9 +401,9 @@ inline size_t strftime(wchar_t* str, size_t count, const wchar_t* format,
}
} // namespace detail
template <typename Char>
struct formatter<std::chrono::time_point<std::chrono::system_clock>, Char>
: formatter<std::tm, Char> {
template <typename Char, typename Duration>
struct formatter<std::chrono::time_point<std::chrono::system_clock, Duration>,
Char> : formatter<std::tm, Char> {
template <typename FormatContext>
auto format(std::chrono::time_point<std::chrono::system_clock> val,
FormatContext& ctx) -> decltype(ctx.out()) {