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::assign (6 of 9 overloads)

Assign to the string.

Synopsis
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 basic_static_string&
assign(
    InputIterator first,
    InputIterator last);
Description

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

Complexity

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

Exception Safety

Strong guarantee.

Template Parameters

Type

Description

InputIterator

The type of the iterators.

Constraints

InputIteratorsatisfies InputIterator.

Return Value

*this

Parameters

Name

Description

first

An iterator referring to the first character to assign.

last

An iterator past the end of the range to assign from.

Exceptions

Type

Thrown On

std::length_error

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


PrevUpHomeNext