std::pair<T1,T2>::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>
| (1) | ||
pair& operator=( const pair& other ); |
(C++20未満) | |
constexpr pair& operator=( const pair& other ); |
(C++20以上) | |
| (2) | ||
template< class U1, class U2 > pair& operator=( const pair<U1,U2>& other ); |
(C++20未満) | |
template< class U1, class U2 > constexpr pair& operator=( const pair<U1,U2>& other ); |
(C++20以上) | |
| (3) | ||
pair& operator=( pair&& other ) noexcept(/* see below */); |
(C++11以上) (C++20未満) |
|
constexpr pair& operator=( pair&& other ) noexcept(/* see below */); |
(C++20以上) | |
| (4) | ||
template< class U1, class U2 > pair& operator=( pair<U1,U2>&& other ); |
(C++11以上) (C++20未満) |
|
template< class U1, class U2 > constexpr pair& operator=( pair<U1,U2>&& other ); |
(C++20以上) | |
ペアの内容を置き換えます。
1) コピー代入演算子。 内容を別のペアの内容のコピーで置き換えます。
2)
other.first を first に、 other.second を second に代入します。3) ムーブ代入演算子。 内容をムーブセマンティクスを用いて
other の内容で置き換えます。4)
std::forward<U1>(p.first) を first に、 std::forward<U2>(p.second) を second に代入します。|
以下の条件を満たさない場合、これらの関数の動作は未定義です。
|
(C++17未満) |
|
これらの関数は、要求される代入演算子が無効な場合、オーバーロード解決に参加しません (または、コピー代入演算子の場合、削除されたものとして定義されます)。 特に、
|
(C++17以上) |
引数
| other | - | このペアの内容を置き換える値のペア |
戻り値
*this。
例外
1-2) (なし)
3)
noexcept 指定:
noexcept( is_nothrow_move_assignable<T1>::value && is_nothrow_move_assignable<T2>::value )4) (なし)
例
| This section is incomplete Reason: no example |