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 064f557086.
PrevUpHomeNext
string::assign (6 of 7 overloads)

Assign characters to a string.

Synopsis
template<
    class InputIt>
string&
assign(
    InputIt first,
    InputIt last);
Description

Replaces the contents with copies of characters in the range {first, last).

Complexity

Linear in std::distance(first, last).

Exception Safety

Strong guarantee. Calls to memory_resource::allocate may throw.

Template Parameters

Type

Description

InputIt

The type of the iterators.

Constraints

InputItsatisfies InputIterator.

Return Value

*this

Parameters

Name

Description

first

An input iterator pointing to the first character to insert, or pointing to the end of the range.

last

An input iterator pointing to the end of the range.

Exceptions

Type

Thrown On

boost::system::system_error

std::distance(first, last) > max_size().


PrevUpHomeNext