You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to format a std::chrono::sys_time<Duration>, where Duration is not the same as std::chrono::system_clock::duration, compilation fails with the static assertion:
static_assert failed due to requirement '!std::is_same<const fmt::v7::detail::unformattable &, const fmt::v7::detail::unformattable &>::value' "Cannot format an argument. To make type T formattable provide a formatter specialization
hinnant/date's format accepts any arbitrary sys_time:
using time_type =
std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds>;
time_type t{std::chrono::seconds{42}};
auto s = date::format(std::locale::classic(), "%S", t);
std::cout << s << "\n"; // prints 42
This is related to issue #2207 where one would want to std::chrono::floor a sys_time to the desired precision for formatting.
The text was updated successfully, but these errors were encountered:
When attempting to format a
std::chrono::sys_time<Duration>
, whereDuration
is not the same asstd::chrono::system_clock::duration
, compilation fails with the static assertion:Godbolt demo: https://godbolt.org/z/7Moc5cKrr
According to https://en.cppreference.com/w/cpp/chrono/system_clock/formatter, C++20's
format
accepts any duration type forsys_time
.hinnant/date's
format
accepts any arbitrarysys_time
:This is related to issue #2207 where one would want to
std::chrono::floor
asys_time
to the desired precision for formatting.The text was updated successfully, but these errors were encountered: