std::pair<T1,T2>::operator=
提供: cppreference.com
(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
の内容で置き換えます。
以下の条件を満たさない場合、これらの関数の動作は未定義です。
|
(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 |