std::uninitialized_copy
Da cppreference.com.
![]() |
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Elemento definito nell'header <memory>
|
||
template< class InputIt, class Size, class ForwardIt > ForwardIt uninitialized_copy_n( InputIt first, Size count, ForwardIt d_first); |
(dal C++11) | |
Copie
count
elementi da un inizio montuoso a first
ad un inizio di memoria non inizializzata zona a d_first
. Gli elementi della zona non inizializzata sono costruiti utilizzando il costruttore di 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.
Se viene generata un'eccezione durante l'inizializzazione, la funzione non ha effetti.
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.
Indice |
[modifica] Parametri
first | - | l'inizio della gamma degli elementi da copiare
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 | - | l'inizio del campo di destinazione
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 .
|
[modifica] Valore di ritorno
Iterator all'elemento passato l'ultimo elemento copiato.
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.
[modifica] Complessità
Lineare in
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.
[modifica] Possibile implementazione
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; } |
[modifica] Esempio
This section is incomplete Reason: no example |
[modifica] Vedi anche
copia una serie di oggetti in una zona di memoria non inizializzata 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. (funzione di modello) |