std::basic_string::insert
De 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. |
<metanoindex/>
<tbody> </tbody> basic_string& insert( size_type index, size_type count, CharT ch ); |
(1) | |
basic_string& insert( size_type index, const CharT* s ); |
(2) | |
basic_string& insert( size_type index, const CharT* s, size_type count ); |
(3) | |
basic_string& insert( size_type index, const basic_string& str ); |
(4) | |
basic_string& insert( size_type index, const basic_string& str, size_type index_str, size_type count ); |
(5) | |
iterator insert( iterator pos, CharT ch ); iterator insert( const_iterator pos, CharT ch ); |
(6) | (avant C++11) (depuis C++11) |
void insert( iterator pos, size_type count, CharT ch ); iterator insert( iterator pos, size_type count, CharT ch ); |
(7) | (avant C++11) (depuis C++11) |
template< class InputIt > void insert( iterator i, InputIt first, InputIt last ); template< class InputIt > iterator insert( const_iterator i, InputIt first, InputIt last ); |
(8) | (avant C++11) (depuis C++11) |
iterator insert( const_iterator pos, std::initializer_list<CharT> ilist ); |
(9) | (depuis C++11) |
Insre des caractres dans la chane:
Original:
Inserts characters into the string:
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.
1)
Inserts
count copies de ch caractre la position de indexOriginal:
Inserts
count copies of character ch at the position indexThe 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.
2)
Insre chane de caractres termine par NULL point par
s au index position. La longueur de la chane est dtermine par le premier caractre null (efficacement les appels Traits::length(s) . Original:
Inserts null-terminated character string pointed to by
s at the position index. The length of the string is determined by the first null character (effectively calls Traits::length(s). 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.
3)
Insre les caractres
count d'abord de la chane de caractres pointe par s la position index. s peut contenir des caractres nuls .Original:
Inserts the first
count characters from the character string pointed to by s at the position index. s can contain null characters.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.
4)
Insre chane
str la position indexOriginal:
Inserts string
str at the position indexThe 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.
5)
Insre une chane, obtenues par
str.substr(index_str, count) la position indexOriginal:
Inserts a string, obtained by
str.substr(index_str, count) at the position indexThe 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.
6)
Inserts
ch caractre avant le caractre point par posOriginal:
Inserts character
ch before the character pointed by posThe 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.
7)
Inserts
count copies de ch caractre avant l'lment point par posOriginal:
Inserts
count copies of character ch before the element pointed to by posThe 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.
8)
Inserts caractres de la gamme
[first, last) Original:
Inserts characters from 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.
9)
Insre les lments de la 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.
You can help to correct and verify the translation. Click here for instructions.
Paramtres
| index | - | position laquelle le contenu doit tre insr
Original: position at 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. |
| pos | - | itrateur devant lequel les personnages seront insrs
Original: iterator before which the characters 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. |
| ch | - | caractre insrer
Original: character to insert The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| count | - | nombre de caractres insrer
Original: number of characters to insert The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| s | - | pointeur vers la chane de caractres insrer
Original: pointer to the character string to insert The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| str | - | Chane insrer
Original: string 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 | - | plage dfinissant des caractres insrer
Original: range defining characters to insert The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| index_str | - | position du premier caractre de la chane insrer
strOriginal: position of the first character in the string str to insertThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| ilist | - | initialiseur liste pour insrer les caractres partir
Original: initializer list to insert the characters 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-5)
*this6-9)
Iterator aprs le dernier caractre insr .
Original:
Iterator following the last inserted character.
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.
Exceptions
2) std::out_of_range if
index > size() and std::length_error if size() + Traits::length(s) > max_size().4)
Lance exceptions aux conditions suivantes:.....
Original:
Throws exceptions on the following conditions:
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.
b)
std::length_error si
size() + str.size() > max_size() o ins_count est le nombre de caractres qui sera tre insr .Original:
std::length_error if
size() + str.size() > max_size() where ins_count is the number of characters that 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.
You can help to correct and verify the translation. Click here for instructions.
5)
Lance exceptions aux conditions suivantes:.....
Original:
Throws exceptions on the following conditions:
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.
c)
std::length_error si
size() + ins_count > max_size() o ins_count est le nombre de caractres qui sera tre insr .Original:
std::length_error if
size() + ins_count > max_size() where ins_count is the number of characters that 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.
You can help to correct and verify the translation. Click here for instructions.
6-9)
(Aucun)
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.
Voir aussi
ajoute des caractres la fin Original: appends characters 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) | |
ajoute un caractre la fin Original: appends a character 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) | |