Namensräume
Varianten
Aktionen

std::chrono::duration::operator+(unary), std::chrono::duration::operator-(unary)

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
 
constexpr duration operator+() const;
(1)
constexpr duration operator-() const;
(2)
Implementiert unären Plus-und unäre Minus für die Dauer .
Original:
Implements unary plus and unary minus for the durations.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Wenn rep_ ist Mitglied Variable, die die Anzahl der Ticks in einer Dauer Objekt
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.
1)
Entspricht return *this;
Original:
Equivalent to 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 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.

Inhaltsverzeichnis

[Bearbeiten] Parameter

(None)
Original:
(none)
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

1)
Eine Kopie dieser Dauer Objekt
Original:
a copy of 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.
2)
Eine Kopie dieser Dauer Objekt mit der Anzahl der Zecken negiert
Original:
a copy of this duration object, with the number of ticks negated
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::seconds s1(10);
    std::chrono::seconds s2 = -s1;
 
    std::cout << "negated 10 seconds are " << s2.count() << " seconds\n";
}

Output:

negated 10 seconds are -10 seconds

[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]