# `std::chrono::zoned_time` 的推导指引

< cpp‎ | chrono‎ | zoned time

zoned_time() -> zoned_time<std::chrono::seconds>; | (1) | (C++20 起)
template< class Duration > zoned_time(std::chrono::sys_time<Duration>) -> zoned_time<std::common_type_t<Duration, std::chrono::seconds>>; | (2) | (C++20 起)
template< class TimeZonePtrOrName > zoned_time(TimeZonePtrOrName&&) -> zoned_time<std::chrono::seconds, /* see below */>; | (3) | (C++20 起)
template< class TimeZonePtrOrName, class Duration > zoned_time(TimeZonePtrOrName&&, std::chrono::sys_time<Duration>) -> zoned_time<std::common_type_t<Duration, std::chrono::seconds>, /* see below */>; | (4) | (C++20 起)
template< class TimeZonePtrOrName, class Duration > zoned_time(TimeZonePtrOrName&&, std::chrono::local_time<Duration>, std::chrono::choose = std::chrono::choose::earliest) -> zoned_time<std::common_type_t<Duration, std::chrono::seconds>, /* see below */>; | (5) | (C++20 起)
template< class TimeZonePtrOrName&&, class Duration, class TimeZonePtr2 > zoned_time(TimeZonePtrOrName, std::chrono::zoned_time<Duration, TimeZonePtr2>, std::chrono::choose = std::chrono::choose::earliest) -> zoned_time<std::common_type_t<Duration, std::chrono::seconds>, /* see below */>; | (6) | (C++20 起)

为 `zoned_time` 提供六个推导指引。它们把 `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> 。