Espacios de nombres
Variantes
Acciones

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

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
 
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)
Realiza asignaciones compuestas entre dos duraciones con el mismo período o entre un período y un valor de recuento de garrapatas .
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.
Si rep_ es la variable miembro que ejerza el número de garrapatas en este objeto de duración
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)
Equivalente a 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)
Equivalente a 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)
Equivalente a 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)
Equivalente a 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)
Equivalente a 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)
Equivalente a 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.

Contenido

[editar] Parámetros

d -
duración en el lado derecho del operador
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 -
número de garrapatas en el lado derecho del operador
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.

[editar] Valor de retorno

Una referencia a este periodo de tiempo después de la modificación
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.

[editar] Ejemplo

#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

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