Deductiongu...::zoned_time(3)
π NAME π
okay so bestie, this is the manual page for Deduction guides for std::chrono::zoned_time, from the C++ Standard Libary manual β page name Deductiongu...::zoned_time(3). The NAME line is literally:
Deductionguidesforstd::chrono::zoned_time - Deductionguidesforstd::chrono::zoned_time
like, yes, it says the same thing twice, and honestly? iconic. π
β¨ Synopsis β¨
hereβs the exact synopsis, no edits, no βfixingβ the line breaks, because code is sacred:
zoned_time() -> zoned_time<std::chrono::seconds>;
(1) (since C++20)
template< class Duration >
zoned_time( std::chrono::sys_time<Duration> )
(2) (since C++20)
-> zoned_time<std::common_type_t<Duration,
std::chrono::seconds>>;
template< class TimeZonePtrOrName >
zoned_time( TimeZonePtrOrName&& ) ->
(3) (since C++20)
zoned_time<std::chrono::seconds, /* see below */>;
template< class TimeZonePtrOrName, class Duration >
zoned_time( TimeZonePtrOrName&&, std::chrono::sys_time<Duration> )
(4) (since C++20)
-> zoned_time<std::common_type_t<Duration,
std::chrono::seconds>, /* see below */>;
template< class TimeZonePtrOrName, class Duration >
zoned_time( TimeZonePtrOrName&&,
std::chrono::local_time<Duration>,
(5) (since C++20)
std::chrono::choose = std::chrono::choose::earliest )
-> zoned_time<std::common_type_t<Duration,
std::chrono::seconds>, /* see below */>;
template< class TimeZonePtrOrName, class Duration, class
TimeZonePtr2 >
zoned_time( TimeZonePtrOrName&&, std::chrono::zoned_time<Duration,
TimeZonePtr2>,
(6) (since C++20)
std::chrono::choose = std::chrono::choose::earliest )
-> zoned_time<std::common_type_t<Duration,
std::chrono::seconds>, /* see below */>;
All six of these guides are (since C++20), periodt. β¨
So the tea: these deduction guides normalize Duration to a minimum resolution of std::chrono::seconds, and they provide correct handling for time zone names specified using types convertible to std::string_view.
3-6)ifstd::is_convertible_v<TimeZonePtrOrName, std::string_view>istrue, the deduced second template argument isconst std::chrono::time_zone*. Otherwise it isstd::remove_cvref_t<TimeZonePtrOrName>.
Guide-by-guide, because we love a numbered list:
(1)β no arguments:zoned_time() -> zoned_time<std::chrono::seconds>;. Since C++20.(2)βtemplate< class Duration >withzoned_time( std::chrono::sys_time<Duration> )deduces tozoned_time<std::common_type_t<Duration, std::chrono::seconds>>;. Since C++20.(3)βtemplate< class TimeZonePtrOrName >withzoned_time( TimeZonePtrOrName&& ) ->deduces tozoned_time<std::chrono::seconds, /* see below */>;. Since C++20.(4)βtemplate< class TimeZonePtrOrName, class Duration >withzoned_time( TimeZonePtrOrName&&, std::chrono::sys_time<Duration> )deduces tozoned_time<std::common_type_t<Duration, std::chrono::seconds>, /* see below */>;. Since C++20.(5)βtemplate< class TimeZonePtrOrName, class Duration >withzoned_time( TimeZonePtrOrName&&, std::chrono::local_time<Duration>, std::chrono::choose = std::chrono::choose::earliest )deduces tozoned_time<std::common_type_t<Duration, std::chrono::seconds>, /* see below */>;. Since C++20.(6)βtemplate< class TimeZonePtrOrName, class Duration, class TimeZonePtr2 >withzoned_time( TimeZonePtrOrName&&, std::chrono::zoned_time<Duration, TimeZonePtr2>, std::chrono::choose = std::chrono::choose::earliest )deduces tozoned_time<std::common_type_t<Duration, std::chrono::seconds>, /* see below */>;. Since C++20.
xoxo, your Unix bestie π β source/version and date: http://cppreference.com, 2024.06.10, manual page Deductiongu...::zoned_time(3). periodt. πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms