Espaces de noms
Variantes
Actions

std::basic_string::insert

De cppreference.com
< cpp‎ | string‎ | basic string

 
 
Bibliothèque de chaînes de caractères
Chaînes à zéro terminal
Original:
Null-terminated strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Les chaînes d'octets
Chaines multi-octets
Les chaînes étendues
Classes
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string
char_traits
 
std::basic_string
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.
basic_string::basic_string
basic_string::operator=
basic_string::assign
basic_string::get_allocator
Elément d'accès
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.
basic_string::at
basic_string::operator[]
basic_string::front (C++11)
basic_string::back (C++11)
basic_string::data
basic_string::c_str
Les itérateurs
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string::begin
basic_string::cbegin

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

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

(C++11)
basic_string::rend
basic_string::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.
basic_string::empty
basic_string::size
basic_string::length
basic_string::max_size
basic_string::reserve
basic_string::capacity
basic_string::shrink_to_fit (C++11)
Opérations
Original:
Operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string::clear
basic_string::insert
basic_string::erase
basic_string::push_back
basic_string::pop_back (C++11)
basic_string::append
basic_string::operator+=
basic_string::compare
basic_string::replace
basic_string::substr
basic_string::copy
basic_string::resize
basic_string::swap
Recherche
Original:
Search
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string::find
basic_string::rfind
basic_string::find_first_of
basic_string::find_first_not_of
basic_string::find_last_of
basic_string::find_last_not_of
Constantes
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string::npos
Tiers fonctions
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator+
operator==
operator!=
operator<
operator>
operator<=
operator>=
swap(std::basic_string)
operator<<
operator>>
getline
stoi
stol
stoll
(C++11)
(C++11)
(C++11)
stoul
stoull
(C++11)
(C++11)
stof
stod
stold
(C++11)
(C++11)
(C++11)
to_string (C++11)
to_wstring (C++11)
Classes d'aide
Original:
Helper classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
hash<std::string>
hash<std::wstring>
hash<std::u32string>
hash<std::u16string>
(C++11)
 
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)
Insère des caractères dans la chaîne:
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.
1)
Inserts count copies de ch caractère à la position de index
Original:
Inserts count copies of character ch at the position index
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Insère chaîne de caractères terminée par NULL pointé par s au index position. La longueur de la chaîne est déterminée par le premier caractère 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.
3)
Insère les caractères count d'abord de la chaîne de caractères pointée par s à la position index. s peut contenir des caractères 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.
4)
Insère chaîne str à la position index
Original:
Inserts string str at the position index
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
5)
Insère une chaîne, obtenues par str.substr(index_str, count) à la position index
Original:
Inserts a string, obtained by str.substr(index_str, count) at the position index
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
6)
Inserts ch caractère avant le caractère pointé par pos
Original:
Inserts character ch before the character pointed by pos
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
7)
Inserts count copies de ch caractère avant l'élément pointé par pos
Original:
Inserts count copies of character ch 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.
8)
Inserts caractères 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.
9)
Insère les éléments 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.

Sommaire

[modifier]Paramètres

index -
position à laquelle le contenu doit être inséré
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 -
itérateur devant lequel les personnages seront insérés
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 -
caractère à insérer
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 caractères à insérer
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 chaîne de caractères à insérer
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 -
Chaîne à insérer
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 définissant des caractères à insérer
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 caractère de la chaîne à insérer str
Original:
position of the first character in the string str to insert
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 pour insérer les caractères à 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.

[modifier]Retourne la valeur

1-5)*this
6-9)
Iterator après le dernier caractère inséré .
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.

[modifier]Exceptions

1)std::out_of_range if index > size() and std::length_error if size()+ count > max_size().
2)std::out_of_range if index > size() and std::length_error if size()+ Traits::length(s)> max_size().
3)std::out_of_range if index > size() and std::length_error if size()+ count > 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.
a)std::out_of_range if index > size().
b)
std::length_error si size()+ str.size()> max_size()ins_count est le nombre de caractères qui sera être inséré .
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.
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.
a)std::out_of_range if index > size().
b)std::out_of_range if index_str > str.size().
c)
std::length_error si size()+ ins_count > max_size()ins_count est le nombre de caractères qui sera être inséré .
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.
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.

[modifier]Voir aussi

ajoute des caractères à 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)[edit]
ajoute un caractère à 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)[edit]
close