Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit 579430ad1f.
PrevUpHomeNext
string::insert (4 of 4 overloads)

Insert a range of characters.

Synopsis
template<
    class InputIt>
string&
insert(
    size_type pos,
    InputIt first,
    InputIt last);
Description

Inserts characters from the range {first, last) before the character at index pos.

Precondition

{first, last)is a valid range.

Exception Safety

Strong guarantee.

Remarks

All references, pointers, or iterators referring to contained elements are invalidated. Any past-the-end iterators are also invalidated.

Template Parameters

Type

Description

InputIt

The type of the iterators.

Constraints

InputItsatisfies InputIterator.

Return Value

*this

Parameters

Name

Description

pos

The index to insert at.

first

The beginning of the character range.

last

The end of the character range.

Exceptions

Type

Thrown On

boost::system::system_error

size() + insert_count > max_size().

boost::system::system_error

pos > size().


PrevUpHomeNext