std::array::swap
提供: cppreference.com
| void swap( array& other ) noexcept(/* see below */); |
(C++11およびそれ以降) | |
コンテナの内容を other の内容と交換します。 イテレータや参照は other コンテナに関連付けられません。
目次 |
[編集] 引数
| other | - | 内容を交換するコンテナ |
[編集] 戻り値
(なし)
[編集] 例外
|
noexcept 指定:
noexcept(noexcept(swap(std::declval<T&>(), std::declval<T&>()))) 上の式において、識別子 |
(C++17以前) |
|
noexcept 指定:
noexcept(std::is_nothrow_swappable<T>::value) |
(C++17およびそれ以降) |
noexcept 指定:
noexcept
[編集] 計算量
コンテナのサイズに比例。
[編集] 欠陥報告
以下の動作変更欠陥報告は以前に発行された C++ 標準に遡って適用されました。
| DR | 適用先 | 発行時の動作 | 正しい動作 |
|---|---|---|---|
| LWG 2456 | C++11 | the noexcept specification is ill-formed
|
made to work |
[編集] 関連項目
| (C++11) |
std::swap アルゴリズムの特殊化 (関数テンプレート) |

