Namespaces
Variants

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

From cppreference.net
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

异常

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

示例

参见

对时间点执行加减运算
(函数模板)