Namensräume
Varianten
Aktionen

std::chrono::duration::operator+=, -=, *=, /=, %=

Aus cppreference.com
< cpp‎ | chrono‎ | duration

 
 
 
 
std::chrono::duration
Member-Funktionen
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
duration::duration
duration::operator=
duration::count
duration::zero
duration::min
duration::max
duration::operator+
duration::operator-
duration::operator++
duration::operator--
duration::operator+=
duration::operator-=
duration::operator*=
duration::operator/=
duration::operator%=
Non-Member-Funktionen
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
common_type
operator+
operator-
operator*
operator/
operator%
operator==
operator!=
operator<
operator<=
operator>
operator>=
duration_cast
Helper-Klassen
Original:
Helper classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
treat_as_floating_point
duration_values
 
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)
Führt Verbindung Zuordnungen zwischen zwei Dauern mit dem gleichen Zeitraum oder zwischen einer Dauer und einem Häkchen Zählwert .
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.
Wenn rep_ die Membervariable hält die Zahl der Zecken in dieser Dauer Objekt ist
Original:
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.
1)
Entspricht 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.
2)
Entspricht 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.
3)
Entspricht 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.
4)
Entspricht 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.
5)
Entspricht 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.
6)
Entspricht 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.

Inhaltsverzeichnis

[Bearbeiten] Parameter

d -
Dauer auf der rechten Seite des Fahrers
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 -
Anzahl Zecken auf der rechten Seite des Fahrers
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.

[Bearbeiten] Rückgabewert

Ein Verweis auf diese Dauer nach Änderung
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.

[Bearbeiten] Beispiel

#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

[Bearbeiten] Siehe auch

erhöht oder verringert die Anzahl der Ticks
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.

(öffentliche Elementfunktion) [edit]
implementiert arithmetische Operationen mit Laufzeiten als Argumente
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.

(Funktions-Template) [edit]