std::chrono::year::operator++, std::chrono::year::operator--
来自cppreference.com
日期和时间工具
时间点 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
时长 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
时钟 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
当天时刻 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
日历 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
时区 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
chrono
I/O
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++20)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
C 风格日期和时间 |
std::chrono::year
成员函数 | ||||
year::operator++year::operator--
|
||||
非成员函数 | ||||
辅助类 | ||||
(C++26)
|
constexpr
std::chrono::year&
operator++()
noexcept;
|
(1) | (C++20 起) |
constexpr
std::chrono::year
operator++(int)
noexcept;
|
(2) | (C++20 起) |
constexpr
std::chrono::year&
operator--()
noexcept;
|
(3) | (C++20 起) |
constexpr
std::chrono::year
operator--(int)
noexcept;
|
(4) | (C++20 起) |
从年份值加或减 1 。
1-2) 进行 *this +=
std::chrono::years{1};
3-4) 进行 *this -=
std::chrono::years{1};
参数
(无)
返回值
1,3) 到修改后的此
year
的引用。
2,4) 修改前所作的
year
的副本。
注意
若结果会在范围 [-32767, 32767] 外,则实际存储值未指定。
示例
本节未完成 原因:暂无示例 |
参阅
从 year 加上或减去年数 (公开成员函数) |
|
(C++20)
|
进行 year 上的算术 (函数) |