std::chrono::zoned_time
的推導指南
來自 cppreference.com
< cpp | chrono | zoned time
zoned_time() -> zoned_time<std::chrono::seconds>; |
(1) | (C++20 起) |
template< class Duration > zoned_time( std::chrono::sys_time<Duration> ) |
(2) | (C++20 起) |
template< class TimeZonePtrOrName > zoned_time( TimeZonePtrOrName&& ) -> zoned_time<std::chrono::seconds, /* 見下文 */>; |
(3) | (C++20 起) |
template< class TimeZonePtrOrName, class Duration > zoned_time( TimeZonePtrOrName&&, std::chrono::sys_time<Duration> ) |
(4) | (C++20 起) |
template< class TimeZonePtrOrName, class Duration > zoned_time( TimeZonePtrOrName&&, std::chrono::local_time<Duration>, |
(5) | (C++20 起) |
template< class TimeZonePtrOrName, class Duration, class TimeZonePtr2 > zoned_time( TimeZonePtrOrName&&, std::chrono::zoned_time<Duration, TimeZonePtr2>, |
(6) | (C++20 起) |
這些推導指南將 `Duration` 歸一化為最小解析度 std::chrono::seconds,併為使用可轉換為 std::string_view 的型別指定的時區名稱提供正確的處理。
3-6) 如果 std::is_convertible_v<TimeZonePtrOrName, std::string_view> 為 true,則推匯出的第二個模板引數是 const std::chrono::time_zone*。否則,它是 std::remove_cvref_t<TimeZonePtrOrName>。