std::swap(std::basic_string)
提供: cppreference.com
<tbody>
</tbody>
<tbody class="t-dcl-rev ">
</tbody><tbody>
</tbody>
| ヘッダ <string> で定義
|
||
template< class CharT, class Traits, class Alloc > void swap( std::basic_string<CharT, Traits, Alloc> &lhs, std::basic_string<CharT, Traits, Alloc> &rhs ); |
(C++17未満) | |
template< class CharT, class Traits, class Alloc > void swap( std::basic_string<CharT, Traits, Alloc> &lhs, std::basic_string<CharT, Traits, Alloc> &rhs ) noexcept(/* see below */); |
(C++17以上) (C++20未満) |
|
template< class CharT, class Traits, class Alloc > constexpr void swap( std::basic_string<CharT, Traits, Alloc> &lhs, std::basic_string<CharT, Traits, Alloc> &rhs ) noexcept(/* see below */); |
(C++20以上) | |
std::swap アルゴリズムを std::basic_string に対して特殊化します。 lhs と rhs の内容を入れ替えます。 lhs.swap(rhs) と同等です。
引数
| lhs, rhs | - | 内容を入れ替える文字列 |
戻り値
(なし)
計算量
一定。
例外noexcept 指定:
noexcept(noexcept(lhs.swap(rhs))) |
(C++17以上) |
関連項目
| 内容を入れ替えます (パブリックメンバ関数) |