名前空間
変種
操作

std::swap(std::tuple)

提供: cppreference.com
< cpp‎ | utility‎ | tuple
 
 
ユーティリティライブラリ
 
 
template< class... Types >
void swap( tuple<Types...>& lhs, tuple<Types...>& rhs ) noexcept(/* see below */);
(C++11以上)
(C++20未満)
template< class... Types >

constexpr void

    swap( tuple<Types...>& lhs, tuple<Types...>& rhs ) noexcept(/* see below */);
(C++20以上)

lhsrhs の内容を入れ替えます。 lhs.swap(rhs) と同等です。

この関数は、 0 から sizeof...(Types) のすべての i に対して std::is_swappable_v<Ti> が true でなければ、オーバーロード解決に参加しません。

(C++17以上)

目次

[編集] 引数

lhs, rhs-内容を入れ替えるタプル

[編集] 戻り値

(なし)

[編集] 例外

noexcept 指定:  
noexcept(noexcept(lhs.swap(rhs)))

[編集] 関連項目