std::vector::insert
Da 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. |
iterator insert( iterator pos, const T& value ); iterator insert( const_iterator pos, const T& value ); |
(1) | (até C++11) (desde C++11) |
iterator insert( const_iterator pos, T&& value ); |
(2) | (desde C++11) |
void insert( iterator pos, size_type count, const T& value ); iterator insert( const_iterator pos, size_type count, const T& value ); |
(3) | (até C++11) (desde C++11) |
template< class InputIt > void insert( iterator pos, InputIt first, InputIt last); |
(4) | (até C++11) (desde C++11) |
iterator insert( const_iterator pos, std::initializer_list<T> ilist ); |
(5) | (desde C++11) |
Insere elementos a posição especificada no recipiente.
1-2) Original:
Inserts elements to specified position in 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.
insere
3) value
antes do elemento apontado por pos
Original:
inserts
value
before the element pointed to by pos
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.
count
insere cópias do value
antes do elemento apontado por pos
Original:
inserts
count
copies of the value
before the element pointed to by pos
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.
insere elementos de
5) [first, last)
faixa antes do elemento apontado por pos
Original:
inserts elements from range
[first, last)
before the element pointed to by pos
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.
insere elementos da lista de inicializador
ilist
.Original:
inserts elements from initializer list
ilist
.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.
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.
Índice |
[editar] Parâmetros
pos | - | elemento antes que o conteúdo será inserido
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 de valor para inserir
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 | - | o intervalo de elementos a inserir, não pode ser iteradores no recipiente para o qual é chamado de inserção
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 | - | inicializador lista para inserir os valores de
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 |