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 7789ef3d8d.
PrevUpHomeNext
string::assign (5 of 7 overloads)

Assign characters to a string.

Synopsis
string&
assign(
    char const* s);
Description

Replaces the contents with those of the null terminated string pointed to by s. The length of the string is determined by the first null character.

Complexity

Linear in strlen(s).

Exception Safety

Strong guarantee.

Remarks

Calls to memory_resource::allocate may throw.

Return Value

*this

Parameters

Name

Description

s

A pointer to a character string used to copy from.

Exceptions

Type

Thrown On

boost::system::system_error

strlen(s) > max_size().


PrevUpHomeNext