string::insert
Insert a string.
Synopsis
string&
insert(
std::size_t pos,
string_view sv); (1)
string&
insert(
std::size_t pos,
std::size_t count,
char ch); (2)
string&
insert(
string::size_type pos,
char ch); (3)
template<
class InputIt>
string&
insert(
string::size_type pos,
InputIt first,
InputIt last); (4)
Description
Inserts the string_view
sv
at the position pos
.
Exception Safety
Strong guarantee.
All references, pointers, or iterators referring to contained elements are invalidated. Any past-the-end iterators are also invalidated. |
Template Parameters
Type | Description |
---|---|
|
The type of the iterators. |
Return Value
*this
Return Value
*this
Return Value
*this
Return Value
*this
Parameters
Name | Description |
---|---|
|
The index to insert at. |
|
The |
|
The number of characters to insert. |
|
The character to insert. |
|
The beginning of the character range. |
|
The end of the character range. |
Exceptions
Type | Thrown On |
---|---|
|
|