The Wayback Machine - https://web.archive.org/web/20180102152902/http://es.cppreference.com:80/w/cpp/algorithm/rotate_copy
Espacios de nombres
Variantes
Acciones

std::rotate_copy

De cppreference.com
< cpp‎ | algorithm

 
 
Algoritmo biblioteca
Funciones
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Para no modificar la secuencia de las operaciones
Original:
Non-modifying sequence operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Modificación de la secuencia de operaciones
Original:
Modifying sequence operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Particionamiento operaciones
Original:
Partitioning operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Clasificación de las operaciones (en rangos ordenados)
Original:
Sorting operations (on sorted ranges)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Las operaciones binarias de búsqueda (en rangos ordenados)
Original:
Binary search operations (on sorted ranges)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Conjunto de operaciones (en rangos ordenados)
Original:
Set operations (on sorted ranges)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Operaciones del montón
Original:
Heap operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Mínimo / máximo de operaciones
Original:
Minimum/maximum operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Operaciones numéricas
Original:
Numeric operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
C biblioteca
Original:
C library
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Defined in header <algorithm>
template<class ForwardIt, class OutputIt >

OutputIt rotate_copy( ForwardIt first, ForwardIt n_first,

                      ForwardIt last, OutputIt d_first );
Copia los elementos de la [first, last) rango, a otro principio rango en d_first de tal manera, que el elemento n_first se convierte en el primer elemento de la nueva gama n_first - 1 y se convierte en el último elemento .
Original:
Copies the elements from the range [first, last), to another range beginning at d_first in such a way, that the element n_first becomes the first element of the new range and n_first - 1 becomes the last element.
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

first, last -
la gama de elementos a copiar
Original:
the range of elements to copy
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
n_first -
el elemento se mueva hasta el principio de la nueva gama
Original:
the element to move to the beginning of the new range
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
d_first -
inicio del rango de destino
Original:
beginning of the destination range
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Type requirements
-
ForwardIt must meet the requirements of ForwardIterator.
-
OutputIt must meet the requirements of OutputIterator.

[editar]Valor de retorno

salida iterador al elemento más allá del último elemento copiado .
Original:
Output iterator to the element past the last element copied.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar]Posible implementación

template<class ForwardIt, class OutputIt> OutputIt rotate_copy(ForwardIt first, ForwardIt n_first, ForwardIt last, OutputIt d_first){ d_first =std::copy(n_first, last, d_first);returnstd::copy(first, n_first, d_first);}

[editar]Ejemplo

[editar]Complejidad

lineal en la distancia entre first y last
Original:
linear in the distance between first and last
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar]Ver también

gira el orden de los elementos en un rango
Original:
rotates the order of elements in a range
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]
close