std::uninitialized_fill
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 ForwardIt, class T > void uninitialized_fill( ForwardIt first, ForwardIt last, const T& value ) |
||
Copia il
value
valore dato ad una zona di memoria non inizializzata, definito dal [first, last)
gamma. Gli elementi della zona non inizializzata sono costruiti utilizzando il costruttore di copia.Original:
Copies the given value
value
to an uninitialized memory area, defined by the range [first, last)
. 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.
Indice |
[modifica] Parametri
first, last | - | la gamma degli elementi per inizializzare
Original: the range of the elements to initialize The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
value | - | il valore di costruire gli elementi con
Original: the value to construct the elements with 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 .
|
[modifica] Valore di ritorno
(Nessuno)
Original:
(none)
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 della distanza tra
first
e 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.
You can help to correct and verify the translation. Click here for instructions.
[modifica] Possibile implementazione
template<class ForwardIt, class T> void uninitialized_fill(ForwardIt first, ForwardIt last, const T& value) { typedef typename std::iterator_traits<ForwardIt>::value_type Value; for (; first != last; ++first) { ::new (static_cast<void*>(&*first)) Value(value); } } |
[modifica] Esempio
This section is incomplete Reason: no example |
[modifica] Vedi anche
copia di un oggetto ad una zona di memoria non inizializzata Original: copies an object 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) |