std::chrono::duration::operator++, std::chrono::duration::operator--
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| duration& operator++(); |
(1) | |
| duration operator++(int); |
(2) | |
| duration& operator--(); |
(3) | |
| duration operator--(int); |
(4) | |
增加或減少這個時間的刻度數.
Original:
Increments or decrements the number of ticks for this duration.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
如果
rep_的刻度數的持續時間對象,是一個成員變數 Original:
If
rep_ is a member variable holding the number of ticks in a duration object, The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
1)
相當於++rep_; return *this;
Original:
Equivalent to ++rep_; return *this;
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
2)
相當於return duration(rep_++)
Original:
Equivalent to return duration(rep_++)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
3)
相當於--rep_; return *this;
Original:
Equivalent to --rep_; return *this;
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
4)
相當於return duration(rep_--);
Original:
Equivalent to return duration(rep_--);
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目錄 |
[编辑] 參數
(無)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 返回值
@ 1,3 @參考這個修改後的時間
Original:
@1,3@ a reference to this duration after modification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
@ 2,4 @副本的期限前作出修改
Original:
@2,4@ a copy of the duration made before modification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 為例
#include <chrono> #include <iostream> int main() { std::chrono::hours h(1); std::chrono::minutes m = ++h; m--; std::cout << m.count() << " minutes\n"; }
Output:
119 minutes
[编辑] 另請參閱
| 實現複合賦值之間的持續時間 Original: implements compound assignment between two durations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
| 實現了算術運算的時間作為參數 Original: implements arithmetic operations with durations as arguments The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函數模板) | |