std::chrono::duration::operator+=, -=, *=, /=, %=
Da cppreference.com.
![]() |
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
duration& operator+=(const duration& d); |
(1) | |
duration& operator-=(const duration& d); |
(2) | |
duration& operator*=(const rep& rhs); |
(3) | |
duration& operator/=(const rep& rhs); |
(4) | |
duration& operator%=(const rep& rhs); |
(5) | |
duration& operator%=(const duration& rhs); |
(6) | |
Esegue compiti composti tra due durate con lo stesso periodo o tra una durata e un valore conteggio.
Original:
Performs compound assignments between two durations with the same period or between a duration and a tick count value.
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.
Se
rep_
è la variabile membro che esercita il numero di zecche in questo oggetto durataOriginal:
If
rep_
is the member variable holding the number of ticks in this 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)
Equivalente a rep_ += d.count(); return *this;
Original:
Equivalent to rep_ += d.count(); 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)
Equivalente a rep_ -= d.count(); return *this;
Original:
Equivalent to rep_ -= d.count(); 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.
3)
Equivalente a rep_ *= rhs; return *this;
Original:
Equivalent to rep_ *= rhs; 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)
Equivalente a rep_ /= rhs; return *this;
Original:
Equivalent to rep_ /= rhs; 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.
5)
Equivalente a rep_ %= rhs; return *this;
Original:
Equivalent to rep_ %= rhs; 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.
6)
Equivalente a rep_ %= d.count(); return *this;
Original:
Equivalent to rep_ %= d.count(); 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.
Indice |
[modifica] Parametri
d | - | durata sulla destra dell'operatore
Original: duration on the right-hand side of the operator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
rhs | - | numero di tacche sul lato destro dell'operatore
Original: number of ticks on the right-hand side of the operator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[modifica] Valore di ritorno
Un riferimento a questa durata dopo modifica
Original:
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.
[modifica] Esempio
#include <chrono> #include <iostream> int main() { std::chrono::minutes m(11); m *= 2; m += std::chrono::hours(10); // hours implicitly convert to minutes std::cout << m.count() << " minutes equals " << std::chrono::duration_cast<std::chrono::hours>(m).count() << " hours and "; m %= std::chrono::hours(1); std::cout << m.count() << " minutes\n"; }
Output:
622 minutes equals 10 hours and 22 minutes
[modifica] Vedi anche
incrementa o decrementa il conteggio Original: increments or decrements the tick count The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) | |
implementa operazioni aritmetiche con durate come argomenti 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. (funzione di modello) |