std::tuple<Types...>::operator=
提供: cppreference.com
<tbody>
</tbody>
<tbody class="t-dcl-rev t-dcl-rev-num ">
</tbody><tbody>
</tbody>
<tbody class="t-dcl-rev t-dcl-rev-num ">
</tbody><tbody>
</tbody>
<tbody class="t-dcl-rev t-dcl-rev-num ">
</tbody><tbody>
</tbody>
<tbody class="t-dcl-rev t-dcl-rev-num ">
</tbody><tbody>
</tbody>
<tbody class="t-dcl-rev t-dcl-rev-num ">
</tbody><tbody>
</tbody>
<tbody class="t-dcl-rev t-dcl-rev-num ">
</tbody><tbody>
</tbody>
| (1) | ||
tuple& operator=( const tuple& other ); |
(C++11以上) (C++20未満) |
|
constexpr tuple& operator=( const tuple& other ); |
(C++20以上) | |
| (2) | ||
tuple& operator=( tuple&& other ) noexcept(/* see below */); |
(C++11以上) (C++20未満) |
|
constexpr tuple& operator=( tuple&& other ) noexcept(/* see below */); |
(C++20以上) | |
| (3) | ||
template< class... UTypes > tuple& operator=( const tuple<UTypes...>& other ); |
(C++11以上) (C++20未満) |
|
template< class... UTypes > constexpr tuple& operator=( const tuple<UTypes...>& other ); |
(C++20以上) | |
| (4) | ||
template< class... UTypes > tuple& operator=( tuple<UTypes...>&& other ); |
(C++11以上) (C++20未満) |
|
template< class... UTypes > constexpr tuple& operator=( tuple<UTypes...>&& other ); |
(C++20以上) | |
| (5) | ||
template< class U1, class U2 > tuple& operator=( const pair<U1,U2>& p ); |
(C++11以上) (C++20未満) |
|
template< class U1, class U2 > constexpr tuple& operator=( const pair<U1,U2>& p ); |
(C++20以上) | |
| (6) | ||
template< class U1, class U2 > tuple& operator=( pair<U1,U2>&& p ); |
(C++11以上) (C++20未満) |
|
template< class U1, class U2 > constexpr tuple& operator=( pair<U1,U2>&& p ); |
(C++20以上) | |
タプルの内容を別のタプルまたはペアの内容で置き換えます。
1) コピー代入演算子。 other の各要素を *this の対応する要素に代入します。
2) ムーブ代入演算子。 すべての i に対して、 std::forward<Ti>(get<i>(other)) を get<i>(*this) に代入します。
3) すべての i に対して、 std::get<i>(other) を std::get<i>(*this) に代入します。
4) すべての i に対して、 std::forward<Ui>(std::get<i>(other)) を std::get<i>(*this) に代入します。
5) p.first を *this の第1要素に、 p.second を *this の第2要素に代入します。
6) std::forward<U1>(p.first) を *this の第1要素に、 std::forward<U2>(p.second) を *this の第2要素に代入します。
|
以下の条件を満たさない場合、これらの関数の動作は未定義です。
|
(C++17未満) |
|
これらの関数は、要求される代入演算子が無効な場合、またはサイズが一致しない場合、オーバーロード解決に参加しません (または、コピー代入演算子の場合、削除されたものとして定義されます)。 特に、
|
(C++17以上) |
引数
| other | - | このタプルの内容を置き換えるタプル |
| p | - | この2要素タプルの内容を置き換えるタプル |
戻り値
*this。
例外
1) (なし)
2)
noexcept 指定:
noexcept( is_nothrow_move_assignable<T0>::value && is_nothrow_move_assignable<T1>::value && is_nothrow_move_assignable<T2>::value && ... )3-6) (なし)
例
| This section is incomplete Reason: no example |