std::chrono::time_point<Clock,Duration>::operator++, std::chrono::time_point<Clock,Duration>::operator--
来自cppreference.com
< cpp | chrono | time point
工具库
日期和时间工具
| 时间点 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 时长 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 时钟 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 当天时刻 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 日历 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 时区 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
chrono
I/O
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
(C++20)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| C 风格日期和时间 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::chrono::time_point
| 成员函数 | ||||
|
time_point::operator++time_point::operator--
(C++20)(C++20)
|
||||
| 非成员函数 | ||||
|
(C++17)
|
||||
|
(C++17)
|
||||
|
(C++17)
|
||||
| 辅助类 | ||||
|
(C++26)
|
|
constexpr
time_point&
operator++();
|
(1) | (C++20 起) |
|
constexpr
time_point operator++(int);
|
(2) | (C++20 起) |
|
constexpr
time_point&
operator--();
|
(3) | (C++20 起) |
|
constexpr
time_point operator--(int);
|
(4) | (C++20 起) |
以 duration 的一个计次修改时间点 *this 。
若 d_ 为此 time_point 对象保有时长(即自纪元起的时间)的成员变量,则
1) 等价于 ++d_; return *this;
2) 等价于 return time_point(d_++)
3) 等价于 --d_; return *this;
4) 等价于 return time_point(d_--);
参数
(无)
返回值
1,3) 到修改后的此
time_point
的引用2,4) 进行修改前的
time_point
的副本示例
| 本节未完成 原因:暂无示例 |
参阅
| 递增或递减滴答计数 ( std::chrono::duration<Rep,Period>
的公开成员函数) |
|
| 以给定的 duration 修改 time_point (公开成员函数) |
|
|
(C++11)
|
实施涉及时间点的加法和减法运算 (函数模板) |