[ Web Proxy ]
URL:
Viewing: https://fr.cppreference.com/cpp/container/vector/insert [Back]  [Original]

std::vector::insert cppreference.com
cppreference.com
Espaces de noms
Variantes

std::vector::insert

De cppreference.com

<metanoindex/>

 
 
 
std::vector
Les fonctions membres
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
vector::vector
vector::~vector
vector::operator=
vector::assign
vector::get_allocator
Elment d'accs
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
vector::at
vector::operator[]
vector::front
vector::back
vector::data (C++11)
Les itrateurs
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
vector::begin
vector::cbegin

(C++11)
vector::end
vector::cend

(C++11)
vector::rbegin
vector::crbegin

(C++11)
vector::rend
vector::crend

(C++11)
Capacit
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
vector::empty
vector::size
vector::max_size
vector::reserve
vector::capacity
vector::shrink_to_fit (C++11)
Modificateurs
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
vector::clear
vector::insert
vector::emplace (C++11)
vector::erase
vector::push_back
vector::emplace_back (C++11)
vector::pop_back
vector::resize
vector::swap
 
<tbody> </tbody>
iterator insert( iterator pos, const T& value ); iterator insert( const_iterator pos, const T& value );
(1) (avant C++11)
(depuis C++11)
iterator insert( const_iterator pos, T&& value );
(2) (depuis C++11)
void insert( iterator pos, size_type count, const T& value ); iterator insert( const_iterator pos, size_type count, const T& value );
(3) (avant C++11)
(depuis C++11)
template< class InputIt > void insert( iterator pos, InputIt first, InputIt last); template< class InputIt > iterator insert( const_iterator pos, InputIt first, InputIt last );
(4) (avant C++11)

(depuis C++11)
iterator insert( const_iterator pos, std::initializer_list<T> ilist );
(5) (depuis C++11)
lments Inserts la position spcifie dans le conteneur .
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.

1-2)

inserts value avant l'lment point par 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.

3)

inserts count copies du value avant l'lment point par 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.

4)

lments inserts de [first, last) plage avant l'lment point par 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.

5)

lments inserts de liste d'initialisation 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.

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.

Paramtres

pos -
lment avant lequel le contenu sera insr
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 -
lment de valeur insrer
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 plage d'lments insrer, ne peut pas tre itrateurs dans le rcipient pour lequel insert est appele
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 -
initialiseur liste d'insrer les valeurs
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.

Retourne la valeur

1-2)

itrateur pointant sur le value insr
Original:
iterator pointing to the inserted value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

3)

itrateur pointant sur le premier lment insr, ou si pos count==0 .
Original:
iterator pointing to the first element inserted, or pos if count==0.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

4)

itrateur pointant sur le premier lment insr, ou si pos first==last .
Original:
iterator pointing to the first element inserted, or pos if first==last.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

5)

itrateur pointant sur le premier lment insr, ou si pos ilist est vide .
Original:
iterator pointing to the first element inserted, or pos if ilist is empty.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Complexit

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.

Voir aussi

(C++11)
construit des lments en mmoire
(fonction membre publique) [edit]
ajoute des lments la fin
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.

(fonction membre publique) [edit]

Web Proxy Viewer  |  New URL  |  Original Page