close
名前空間
変種

std::swap(std::list)

提供: cppreference.com
 
 
 
 
<tbody> </tbody>
ヘッダ <list> で定義
template< class T, class Alloc > void swap( list<T,Alloc>& lhs, list<T,Alloc>& rhs );
(C++17未満)
template< class T, class Alloc > void swap( list<T,Alloc>& lhs, list<T,Alloc>& rhs ) noexcept(/* see below */);
(C++17以上)

std::list に対する std::swap アルゴリズムの特殊化。 lhsrhs の内容を入れ替えます。 lhs.swap(rhs) を呼びます。


引数

lhs, rhs - 内容を入れ替えるコンテナ

戻り値

(なし)

計算量

一定。

例外

noexcept 指定:  
noexcept(noexcept(lhs.swap(rhs)))
(C++17以上)

関連項目

(C++11)
内容を入れ替えます
(パブリックメンバ関数) [edit]