std::chrono::zoned_traits(3)
πΈ NAME πΈ
std::chrono::zoned_traits β std::chrono::zoned_traits
okay so bestie, this is the std::chrono::zoned_traits(3) page from the C++ Standard Library manual, and itβs lowkey iconic if youβre messing with custom time zone pointer types. π
β¨ Synopsis β¨
Defined in header <chrono>
template < class TimeZonePtr > (1) (since C++20)
struct zoned_traits { };
template <> (2) (since C++20)
struct zoned_traits<const std::chrono::time_zone*>;
So zoned_traits is literally the customization hook for the behavior of the constructors of std::chrono::zoned_time when you roll with custom time zone pointer types. In particular, it allows such types to specify the default time zone to use and the mapping of a time zoneβs name to the corresponding time zone pointer. π¦
No cap, itβs totally acceptable for custom time zone pointer types to not support either operation β and when that happens, the corresponding constructors of zoned_time will not participate in overload resolution. Thatβs the vibe check, iykyk. π«Ά
The primary template is empty. Thereβs a specialization provided for const std::chrono::time_zone*, which is the default time zone pointer type. π
π Member functions π
π std::chrono::zoned_traits<const std::chrono::time_zone*>::default_zone π
static const std::chrono::time_zone* default_zone();
This one returns a time zone pointer for the default time zone (UTC). β
π Return value π
Itβs std::chrono::locate_zone("UTC") β periodt. β¨
π¦ std::chrono::zoned_traits<const std::chrono::time_zone*>::locate_zone π¦
static const std::chrono::time_zone* locate_zone(std::string_view name);
This one returns the time zone pointer for the time zone designated by name. π
π Return value π
Itβs std::chrono::locate_zone(name). Slay. π
ok bye bestie π«Ά this came from http://cppreference.com, with the footer date 2024.06.10, and itβs the std::chrono::zoned_traits(3) manual page. mwah π
β¨
π¦ 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