Difference between revisions of "cpp/utility/tuple/operator="
m (Text replace - "{{cpp|" to "{{c|") |
m (Text replace - "/sidebar" to "/navbar") |
||
Line 1: | Line 1: | ||
{{cpp/utility/tuple/title | operator{{=}}}} | {{cpp/utility/tuple/title | operator{{=}}}} | ||
− | {{cpp/utility/tuple/ | + | {{cpp/utility/tuple/navbar}} |
{{ddcl list begin}} | {{ddcl list begin}} | ||
{{ddcl list item | num=1 | notes={{mark since c++11}} | 1= | {{ddcl list item | num=1 | notes={{mark since c++11}} | 1= |
Revision as of 14:18, 15 June 2012
Template:ddcl list begin <tr class="t-dcl ">
<td ><td > (1) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td ><td > (2) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td >tuple& operator=( const tuple<UTypes...>& other );
<td > (3) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td >tuple& operator=( tuple<UTypes...>&& other );
<td > (4) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td >tuple& operator=( const pair<U1,U2>& p );
<td > (5) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td >tuple& operator=( pair<U1,U2>&& p );
<td > (6) </td> <td > (since C++11) </td> </tr> Template:ddcl list end
Replaces the contents of the tuple with the contents of another tuple or a pair.
1) Copy assignment operator. Replaces each element with a copy of the corresponding element of other
.
2) Move assignment operator. Replaces each element with the corresponding element of other
using move semantics.
3) For all i
, assigns std::get<i>(other) to std::get<i>(*this).
4) For all i
, assigns std::forward<Ui>(std::get<i>(other)) to std::get<i>(*this).
5) Assigns p.first to the first element of *this and p.second to the second element of *this.
6) Assigns std::forward<U1>(p.first) to the first element of *this and std::forward<U2>(p.second) to the second element of *this.
Contents |
Parameters
other | - | tuple to replace the contents of this tuple |
p | - | pair to replace the contents of this 2-tuple |
Return value
*this
Exceptions
1) (none)
2) is_nothrow_move_assignable<T0>::value &&
is_nothrow_move_assignable<T1>::value &&
is_nothrow_move_assignable<T2>::value &&
...
3-5) (none)
6)Example
This section is incomplete Reason: no example |