...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Insert into the string.
template< [role red error.param neither has a declname nor a 'class ' prefix in the type][role red error.param neither has a declname nor a 'class ' prefix in the type][role red error.param neither has a declname nor a 'class ' prefix in the type][role red error.param neither has a declname nor a 'class ' prefix in the type]> constexpr iterator insert( const_iterator pos, InputIterator first, InputIterator last);
Inserts characters from the range {first, last)
before the character pointed to by pos
.
pos
shall be valid within
{data()
,
data()
+ size()
},
{first, last)
shall be a valid range
Strong guarantee.
All references, pointers, or iterators referring to contained elements are invalidated. Any past-the-end iterators are also invalidated.
Type |
Description |
---|---|
|
The type of the iterators. |
InputIterator
satisfies
InputIterator and does not satisfy
ForwardIterator.
An iterator which refers to the first inserted character or pos
if no characters were inserted
Name |
Description |
---|---|
|
The position to insert at. |
|
An iterator representing the first character to insert. |
|
An iterator representing one past the last character to insert. |
Type |
Thrown On |
---|---|
|
|