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
string::operator= (3 of 4 overloads)

Assign a value to the string.

Synopsis
string&
operator=(
    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 std::strlen(s).

Exception Safety

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

Return Value

*this

Parameters

Name

Description

s

The null-terminated character string.

Exceptions

Type

Thrown On

std::length_error

std::strlen(s) > max_size().


PrevUpHomeNext