| Home | Libraries | People | FAQ | More

##### basic_static_string::assign (3 of 9 overloads)

Assign to the string.

###### Synopsis

    template<
        std::size_t M>
    constexpr basic_static_string&
    assign(
        const basic_static_string< M, CharT, Traits >& s,
        basic_static_string::size_type pos,
        basic_static_string::size_type count = basic_static_string::npos);

###### Description

Replaces the contents with those of the string `sub`, where `sub` is `s.substr(pos, count)`.

###### Complexity

Linear in `sub.size()`.

###### Exception Safety

Strong guarantee.

###### Template Parameters

Type | Description
--- | ---
`M` | The capacity of the other string.

###### Return Value

`*this`

###### Parameters

Name | Description
--- | ---
`s` | The string to replace the contents with.
`pos` | The index at which to begin the substring.
`count` | The size of the substring. The default argument for this parameter is `npos`.

###### Exceptions

Type | Thrown On
--- | ---
`std::length_error` | `sub.size() > max_size()`.