std::chrono::duration::operator+(unary), std::chrono::duration::operator-(unary)
Da 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. |
constexpr duration operator+() const; |
(1) | |
constexpr duration operator-() const; |
(2) | |
Implementa menos unário unário mais e para as durações.
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.
You can help to correct and verify the translation. Click here for instructions.
Se
rep_
é uma variável que exerce o número de carrapatos em um objeto de duração 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)
Equivalente a 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.
You can help to correct and verify the translation. Click here for instructions.
2)
Equivalente a 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.
Índice |
[editar] Parâmetros
(Nenhum)
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.
[editar] Valor de retorno
1)
uma cópia deste objeto de duração
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.
You can help to correct and verify the translation. Click here for instructions.
2)
uma cópia do objecto duração, com o número de tiques negados
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.
You can help to correct and verify the translation. Click here for instructions.
[editar] Exemplo
#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"; }
Saída:
negated 10 seconds are -10 seconds
[editar] Veja também
aumenta ou diminui a contagem em escala 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. (função pública membro) | |
implementa operações aritméticas com durações como argumentos 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. (modelo de função) |