std::swap(std::stack)
提供: cppreference.com
ヘッダ <stack> で定義
|
||
template< class T, class Container > void swap( stack<T,Container>& lhs, |
(C++17未満) | |
template< class T, class Container > void swap( stack<T,Container>& lhs, |
(C++17以上) | |
std::stack に対する std::swap アルゴリズムの特殊化。 lhs
と rhs
の内容を入れ替えます。 lhs.swap(rhs) を呼びます。
このオーバーロードは、std::is_swappable<Container>::value が true である場合にのみ、オーバーロード解決に参加します。 |
(C++17以上) |
目次 |
[編集] 引数
lhs, rhs | - | 内容を入れ替えるコンテナ |
[編集] 戻り値
(なし)
[編集] 計算量
ベースとなるコンテナの swap と同じ。
[編集] 例外
noexcept 指定:
noexcept(noexcept(lhs.swap(rhs))) |
(C++17以上) |
[編集] 関連項目
(C++11) |
内容を入れ替えます (パブリックメンバ関数) |