std::chrono:: zoned_traits
|
定义于头文件
<chrono>
|
||
|
template
<
class
TimeZonePtr
>
struct zoned_traits { } ; |
(1) | (C++20 起) |
|
template
<>
struct zoned_traits < const std:: chrono :: time_zone * > ; |
(2) | (C++20 起) |
类
zoned_traits
提供了一种方式,用于通过自定义时区指针类型来定制
std::chrono::zoned_time
构造函数的行为。具体而言,它允许此类类型指定要使用的默认时区以及时区名称到对应时区指针的映射。自定义时区指针类型可以不支持其中任一操作,在这种情况下,
zoned_time
的相应构造函数将不参与重载决议。
主模板为空。为 const std:: chrono :: time_zone * 提供了特化版本,这是默认时区指针类型。
目录 |
成员函数
std::chrono::zoned_traits<const std::chrono::time_zone*>:: default_zone
|
static
const
std::
chrono
::
time_zone
*
default_zone
(
)
;
|
||
返回默认时区(UTC)的时间区域指针。
返回值
std:: chrono :: locate_zone ( "UTC" ) 。
std::chrono::zoned_traits<const std::chrono::time_zone*>:: locate_zone
|
static
const
std::
chrono
::
time_zone
*
locate_zone
(
std::
string_view
name
)
;
|
||
返回由
name
指定的时区的时区指针。
返回值
std:: chrono :: locate_zone ( name ) 。