std::chrono::time_point<Clock,Duration>::运算符++, std::chrono::time_point<Clock,Duration>::运算符--
来自 cppreference.cn
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 起) |
修改此 *this 表示的时间点,增加或减少一个 duration
的时钟节拍。
如果 d_
是一个成员变量,持有此 time_point
对象的 duration (即,自 epoch 以来经过的时间),
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 修改时间点 (公共成员函数) | |
(C++11) |
执行涉及时间点的加法和减法运算 (函数模板) |