(1) | ||
pair& operator=( const pair& other ); | (until C++20) | |
constexpr pair& operator=( const pair& other ); | (since C++20) | |
(2) | ||
template< class U1, class U2 > pair& operator=( const pair<U1,U2>& other ); | (until C++20) | |
template< class U1, class U2 > constexpr pair& operator=( const pair<U1,U2>& other ); | (since C++20) | |
(3) | ||
pair& operator=( pair&& other ) noexcept(/* see below */); | (since C++11) (until C++20) | |
constexpr pair& operator=( pair&& other ) noexcept(/* see below */); | (since C++20) | |
(4) | ||
template< class U1, class U2 > pair& operator=( pair<U1,U2>&& other ); | (since C++11) (until C++20) | |
template< class U1, class U2 > constexpr pair& operator=( pair<U1,U2>&& other ); | (since C++20) |
Replaces the contents of the pair.
other.first
to first
and other.second
to second
other
using move semantics. The behavior of these functions is undefined unless:
| (until C++17) |
These functions do not participate in overload resolution (or, for the copy assignment operator, is defined as deleted) if any required assignment operation is invalid. Specifically:
| (since C++17) |
other | - | pair of values to replace the contents of this pair |
*this
.
noexcept
specification: noexcept( is_nothrow_move_assignable<T1>::value && is_nothrow_move_assignable<T2>::value )
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/utility/pair/operator=