##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::basic_string_view::swap

From cppreference.com
< cpp‎ | string‎ | basic string view

constexpr void swap(basic_string_view& v); |  | (since C++17)

Exchanges the view with that of `v`.

### [edit] Parameters

v | - | view to swap with

### [edit] Return value

(none)

### [edit] Exceptions

`noexcept` specification:
noexcept

### [edit] Complexity

Constant.

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/string/basic_string_view/swap&oldid=91860"
Category:

- unconditionally noexcept

Hidden categories:

- Pages with unreviewed unconditional noexcept template
- Pages with unreviewed noexcept template