std::chrono::zoned_time<Duration,TimeZonePtr>::operator=
来自cppreference.com
< cpp | chrono | zoned time
工具库
日期和时间工具
时间点 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
时长 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
时钟 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
当天时刻 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
日历 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
时区 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
chrono
I/O
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++20)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
C 风格日期和时间 |
std::chrono::zoned_time
成员函数 | ||||
zoned_time::operator=
|
||||
非成员函数 | ||||
辅助类 | ||||
(C++26)
|
||||
推导指引 |
zoned_time&
operator=(const
zoned_time&
other)
= default;
|
(1) | (C++20 起) |
zoned_time&
operator=(const
std::chrono::sys_time<Duration>&
other);
|
(2) | (C++20 起) |
zoned_time&
operator=(const
std::chrono::local_time<Duration>&
other);
|
(3) | (C++20 起) |
赋 other
的值给 *this
。
1) 默认化的复制赋值运算符。复制赋值存储的时间点及存储的时区指针。
zoned_time
无移动赋值运算符;移动即是复制。2) 赋值
other
给存储的时间点。不更改时区指针。调用后 get_sys_time()
== other 。3) 如同用 zone->to_sys(other) 转换
other
为 std::chrono::sys_time (其中
zone
是保有存储的时区指针的非静态数据成员)再赋值结果给存储的时间点。不更改时区指针。调用后 get_local_time()
== other 。返回值
*this
。