命名空间
变体
操作

std::chrono::time_point<Clock,Duration>::operator+=, operator-=

来自 cppreference.cn
< cpp‎ | chrono‎ | time_point
 
 
 
 
time_point& operator+=( const duration& d );
(1) (C++11 起)
(自 C++17 起为 constexpr)
time_point& operator-=( const duration& d );
(2) (C++11 起)
(自 C++17 起为 constexpr)

通过给定的时长修改时间点。

1) 将偏移量 d 应用到 pt。实际上,将 d 加到内部存储的时长 d_ 上,即 d_ += d
2) 将偏移量 d 以负方向应用到 pt。实际上,从内部存储的时长 d_ 中减去 d,即 d_ -= d

目录

[编辑] 参数

d - 要应用的时间偏移量

[编辑] 返回值

*this

[编辑] 异常

可能抛出实现定义的异常。

[编辑] 示例

[编辑] 参阅

执行涉及时间点的加法和减法运算
(函数模板) [编辑]