std::chrono::time_point<Clock,Duration>:: operator++, std::chrono::time_point<Clock,Duration>:: operator--
From cppreference.net
<
cpp
|
chrono
|
time point
C++
Date and time library
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::chrono::time_point
| Member functions | ||||
|
time_point::operator++
time_point::operator--
(C++20)
(C++20)
|
||||
| Non-member functions | ||||
|
(until C++20)
(C++20)
|
||||
|
(C++17)
|
||||
|
(C++17)
|
||||
|
(C++17)
|
||||
| Helper classes | ||||
|
(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 起) |
将
*
this
所表示的时间点按
duration
的一个刻度进行修改。
如果
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>
的公开成员函数)
|
|
|
通过给定时长修改时间点
(公开成员函数) |
|
|
(C++11)
|
执行涉及时间点的加减运算
(函数模板) |