Namespaces
Variants
Actions

Deduction guides for std::chrono::zoned_time

From cppreference.com
< cpp‎ | chrono‎ | zoned time
 
C++
 
Date and time library
Time point
(C++11)
(C++20)
Duration
(C++11)
Clocks
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Time of day
(C++20)(C++20)
(C++20)(C++20)
(C++20)
Calendar
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)
chrono I/O
(C++20)

 
std::chrono::zoned_time
zoned_time() -> zoned_time<std::chrono::seconds>;
(1) (since C++20)
template< class Duration >

zoned_time( std::chrono::sys_time<Duration> )

    -> zoned_time<std::common_type_t<Duration, std::chrono::seconds>>;
(2) (since C++20)
template< class TimeZonePtrOrName >
zoned_time( TimeZonePtrOrName&& ) -> zoned_time<std::chrono::seconds, /* see below */>;
(3) (since 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) (since 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) (since 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) (since C++20)

These deduction guides normalize Duration to a minimum resolution of std::chrono::seconds, and provide correct handling for time zone names specified using types convertible to std::string_view.

3-6) If std::is_convertible_v<TimeZonePtrOrName, std::string_view> is true, the deduced second template argument is const std::chrono::time_zone*. Otherwise it is std::remove_cvref_t<TimeZonePtrOrName>.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant