名稱空間
變體
操作

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

來自 cppreference.com
< 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

[編輯] 異常

可能丟擲實現定義的異常。

[編輯] 示例

[編輯] 參閱

執行涉及時間點的加法和減法運算
(函式模板) [編輯]