std::vector::insert
![]() | 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. |
iterator insert( iterator pos, const T& value ); iterator insert( const_iterator pos, const T& value ); | (1) | (fino al c++11) (dal C++11) |
iterator insert( const_iterator pos, T&& value ); | (2) | (dal C++11) |
void insert( iterator pos, size_type count, const T& value ); iterator insert( const_iterator pos, size_type count, const T& value ); | (3) | (fino al c++11) (dal C++11) |
template<class InputIt > void insert( iterator pos, InputIt first, InputIt last); | (4) | (fino al c++11) (dal C++11) |
iterator insert( const_iterator pos, std::initializer_list<T> ilist ); | (5) | (dal C++11) |
You can help to correct and verify the translation. Click here for instructions.
value
prima che l'elemento puntato da pos
value
before the element pointed to by pos
You can help to correct and verify the translation. Click here for instructions.
count
copie del value
prima l'elemento puntato da pos
count
copies of the value
before the element pointed to by pos
You can help to correct and verify the translation. Click here for instructions.
[first, last)
campo prima che l'elemento puntato da pos
[first, last)
before the element pointed to by pos
You can help to correct and verify the translation. Click here for instructions.
ilist
.ilist
.You can help to correct and verify the translation. Click here for instructions.
Causes reallocation if the new size()
is greater than the old capacity()
.If the new size()
is greater than capacity()
, all iterators and references are invalidated. Otherwise, only the iterators and references after the added element are invalidated.
Indice |
[modifica]Parametri
pos | - | elemento prima che il contenuto verrà inserito Original: element before which the content will be inserted The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
value | - | elemento di valore da inserire Original: element value to insert The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
first, last | - | la gamma di elementi da inserire, non può essere iteratori in contenitore con cui è chiamato inserto Original: the range of elements to insert, can't be iterators into container for which insert is called The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
ilist | - | inizializzatore lista per inserire i valori da Original: initializer list to insert the values 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]Valore di ritorno
1-2)value
inseritovalue
You can help to correct and verify the translation. Click here for instructions.
pos
count==0.pos
if count==0.You can help to correct and verify the translation. Click here for instructions.
pos
first==last.pos
if first==last.You can help to correct and verify the translation. Click here for instructions.
pos
ilist
è vuoto.pos
if ilist
is empty.You can help to correct and verify the translation. Click here for instructions.
[modifica]Complessità
1-2) Constant plus linear in the distance between pos
and end of the container.
3) Linear in count plus linear in the distance between pos
and end of the container.
4) Linear in std::distance(first, last) plus linear in the distance between pos
and end of the container.
5) Linear in ilist.size() plus linear in the distance between pos
and end of the container.
[modifica]Vedi anche
(C++11) | constructs element in-place (metodo pubblico) |
aggiunge elementi alla fine Original: adds elements to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) |