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 an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
basic_static_string::insert (7 of 11 overloads)

Insert into the string.

Synopsis
constexpr iterator
insert(
    const_iterator pos,
    size_type count,
    value_type ch);
Description

Inserts count copies of ch before the character pointed by pos.

Precondition

posshall be valid within {data(), data() + size()}

Exception Safety

Strong guarantee.

Remarks

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

Return Value

An iterator which refers to the first inserted character or pos if no characters were inserted

Parameters

Name

Description

pos

The position to insert at.

count

The number of characters to insert.

ch

The character to insert.

Exceptions

Type

Thrown On

std::length_error

size() + count > max_size()


PrevUpHomeNext