| Home | Libraries | People | FAQ | More

##### basic_static_string::swap (2 of 2 overloads)

Swap two strings.

###### Synopsis

    template<
        std::size_t M>
    void
    swap(
        basic_static_string< M, CharT, Traits >& s);

###### Description

Swaps the contents of the string and `s`.

###### Exception Safety

Strong guarantee.

###### Remarks

All references, pointers, or iterators referring to contained elements are invalidated. Any past-the-end iterators are also invalidated.

###### Template Parameters

Type | Description
--- | ---
`M` | The size of the string to swap with.

###### Parameters

Name | Description
--- | ---
`s` | The string to swap with.

###### Exceptions

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