Espacios de nombres
Variantes
Acciones

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

De cppreference.com
< cpp‎ | chrono‎ | duration
 
 
 
Utilidades de fecha y hora
(C++11)
(C++11)
Relojes
(C++20)
                                                  
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Calendarios
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Husos horarios
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Fecha y hora estilo C
 
std::chrono::duration
Las funciones miembro
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::operator+duration::operator-
Terceros funciones
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.
Clases de ayuda
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.
 
constexpr duration operator+() const;
(1)
constexpr duration operator-() const;
(2)
Implementa unarios positivo y negativo unario para las duraciones .
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.
Si rep_ es una variable miembro que tiene el número de garrapatas en un objeto de duración
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)
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.
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.

Contenido

[editar] Parámetros

(Ninguno)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

1)
una copia de este objeto de duración
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)
una copia de este objeto de duración, con el número de garrapatas 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.

[editar] Ejemplo

#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";
}

Salida:

negated 10 seconds are -10 seconds

[editar] Ver también

aumenta o disminuye el contador
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.

(función miembro pública) [editar]
Implementa operaciones aritméticas con intervalos de tiempo como argumentos.
(plantilla de función) [editar]