Espacios de nombres
Variantes
Acciones

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

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

 
 
Utilidades de la biblioteca
Escriba apoyo (basic types, RTTI, type traits)
Gestión de memoria dinámica
Gestión de errores
Programa de servicios públicos
Funciones variadic
Fecha y hora
Objetos Function
initializer_list(C++11)
bitset
hash(C++11)
Operadores relacionales
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Pares y tuplas
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
Cambiar, hacia adelante y mover
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
 
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::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%=
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.
common_type
operator+
operator-
operator*
operator/
operator%
operator==
operator!=
operator<
operator<=
operator>
operator>=
duration_cast
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.
treat_as_floating_point
duration_values
 
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";
}

Output:

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.

(miembro público función) [edit]
implementa las operaciones aritméticas con duraciones 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.

(función de plantilla) [edit]