std::uninitialized_copy
De 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. |
| Defined in header <memory>
|
||
| template< class InputIt, class Size, class ForwardIt > ForwardIt uninitialized_copy_n( InputIt first, Size count, ForwardIt d_first); |
(ya que C + +11) | |
Copias
count elementos de una serie de principios para un comienzo first memoria no inicializada en el área d_first. Los elementos en el área sin inicializar se construyen utilizando constructor de copia .Original:
Copies
count elements from a range beginning at first to an uninitialized memory area beginning at d_first. The elements in the uninitialized area are constructed using copy constructor.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.
Si se produce una excepción durante la inicialización, la función no tiene ningún efecto.
| This section is incomplete Reason: update possible implementation to reflect this |
Original:
If an exception is thrown during the initialization, the function has no effects.
| This section is incomplete Reason: update possible implementation to reflect 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.
Contenido |
[editar] Parámetros
| first | - | el comienzo de la gama de los elementos a copiar
Original: the beginning of the range of the 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. |
| d_first | - | el comienzo del rango de destino
Original: the 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 | ||
-InputIt must meet the requirements of InputIterator.
| ||
-ForwardIt must meet the requirements of ForwardIterator.
| ||
[editar] Valor de retorno
Iterator al elemento pasado el último elemento copiado .
Original:
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.
You can help to correct and verify the translation. Click here for instructions.
[editar] Complejidad
Lineal en
count .Original:
Linear in
count.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] Posible implementación
template<class InputIt, class Size, class ForwardIt> ForwardIt uninitialized_copy_n(InputIt first, Size count, ForwardIt d_first) { typedef typename std::iterator_traits<ForwardIt>::value_type Value; for (; count > 0; ++first, ++d_first, --count) { ::new (static_cast<void*>(&*d_first)) Value(*first); } return d_first; } |
[editar] Ejemplo
| This section is incomplete Reason: no example |
[editar] Ver también
| copia un rango de objetos a una zona de memoria no inicializada Original: copies a range of objects to an uninitialized area of memory 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) | |