std::chrono::operator+, std::chrono::operator- (std::chrono::year_month_weekday_last)
时间点 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
时长 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
时钟 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
当天时刻 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
日历 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
时区 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
chrono
I/O
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++20)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
C 风格日期和时间 |
成员函数 | ||||
非成员函数 | ||||
operator+operator-
|
||||
辅助类 | ||||
constexpr
std::chrono::year_month_weekday_last
operator+(const
std::chrono::year_month_weekday_last&
ymwdl, |
(C++20 起) | |
constexpr
std::chrono::year_month_weekday_last
operator+(const
std::chrono::months&
dm, |
(C++20 起) | |
constexpr
std::chrono::year_month_weekday_last
operator+(const
std::chrono::year_month_weekday_last&
ymwdl, |
(C++20 起) | |
constexpr
std::chrono::year_month_weekday_last
operator+(const
std::chrono::years&
dy, |
(C++20 起) | |
constexpr
std::chrono::year_month_weekday_last
operator-(const
std::chrono::year_month_weekday_last&
ymwdl, |
(C++20 起) | |
constexpr
std::chrono::year_month_weekday_last
operator-(const
std::chrono::year_month_weekday_last&
ymwdl, |
(C++20 起) | |
ymwdl
所表示的日期。结果与 std::chrono::year_month(ymwdl.year(),
ymwdl.month())
+ dm 拥有相同的
year()
和 month()
,并与 ymwdl
拥有相同的
weekday()
。ymwdl
所表示的日期。结果等价于 std::chrono::year_month_weekday_last(ymwdl.year()
+ dy, ymwdl.month(),
ymwd.weekday_last()) 。ymwdl
所表示的日期减去
dm.count() 月。等价于 ymwdl+ -dm 。ymwdl
所表示的日期减去
dy.count() 年。等价于 ymwdl + -dy 。对于能转换到 std::chrono::years 与 std::chrono::months 两者的时长,若调用本会有歧义则偏好
years
重载 (3,4,6) 。