std::list::assign
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. |
void assign( size_type count, const T& value ); |
(1) | |
template< class InputIt > void assign( InputIt first, InputIt last ); |
(2) | |
Sostituisce il contenuto del contenitore.
1) Original:
Replaces the contents of the container.
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.
sostituisce il contenuto con le copie di
2) count
value
valoreOriginal:
replaces the contents with
count
copies of value value
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.
sostituisce il contenuto con le copie di quelli del
[first, last)
gammaOriginal:
replaces the contents with copies of those in the range
[first, 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.
Indice |
[modifica] Parametri
count | - | la nuova dimensione del contenitore
Original: the new size of the container 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 per inizializzare elementi del contenitore
Original: the value to initialize elements of the container with The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
first, last | - | l'intervallo per copiare gli elementi da
Original: the range to copy the elements from 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 .
|
[modifica] Complessità
1)lineare in
2) 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.
lineare di distanza tra
first
e last
Original:
linear in 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] Esempio
Il codice seguente utilizza
assign
per aggiungere diversi personaggi a un std::list<char>:
Original:
The following code uses
assign
to add several characters to a std::list<char>:
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.
Output:
a a a a a
[modifica] Vedi anche
costruisce il list (metodo pubblico) |