string::operator=

Copy assignment.

Synopsis

string&
operator=(
    string const& other); (1)

string&
operator=(
    string&& other); (2)

string&
operator=(
    char const* s); (3)

string&
operator=(
    string_view s); (4)

Description

Replace the contents with a copy of other.

Complexity

Linear in other.size().

Exception Safety

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

Return Value

*this

Return Value

*this

Return Value

*this

Return Value

*this

Parameters

Name Description

other

The string to use as a source to copy from.

s

The null-terminated character string.

Exceptions

Type Thrown On

boost::system::system_error

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