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
basic_static_string::swap (2 of 2 overloads)

Swap two strings.

Synopsis
template<
    std::size_t M>
constexpr 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()


PrevUpHomeNext