std::tuple::operator=
来自cppreference.com
![]() |
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
tuple& operator=( const tuple& other ); |
(1) | (C++11 起) |
tuple& operator=( tuple&& other ); |
(2) | (C++11 起) |
template< class... UTypes > tuple& operator=( const tuple<UTypes...>& other ); |
(3) | (C++11 起) |
template< class... UTypes > tuple& operator=( tuple<UTypes...>&& other ); |
(4) | (C++11 起) |
template< class U1, class U2 > tuple& operator=( const pair<U1,U2>& p ); |
(5) | (C++11 起) |
template< class U1, class U2 > tuple& operator=( pair<U1,U2>&& p ); |
(6) | (C++11 起) |
与另一个元组或一对的内容的元组的内容替换.
1) 原文:
Replaces the contents of the tuple with the contents of another tuple or a pair.
复制赋值操作者。替换每个元素的对应元素
2) other
的副本.原文:
Copy assignment operator. Replaces each element with a copy of the corresponding element of
other
.将赋值运算符。
3) other
使用移动语义的对应元素,每个元素替换. 原文:
Move assignment operator. Replaces each element with the corresponding element of
other
using move semantics. 对于所有
4)
5) i
,分配std::get<i>(other)到std::get<i>(*this).原文:
For all
i
, assigns std::get<i>(other) to std::get<i>(*this).分配到的第一个元素的第二个元素p.first*this和p.second*this.
6) 原文:
Assigns p.first to the first element of *this and p.second to the second element of *this.
分配到的第一个元素的第二个元素std::forward<U1>(p.first)*this和std::forward<U2>(p.second)*this.
原文:
Assigns std::forward<U1>(p.first) to the first element of *this and std::forward<U2>(p.second) to the second element of *this.
目录 |
[编辑] 参数
other | - | 元组中的内容替换该元组
原文: tuple to replace the contents of this tuple |
p | - | 对代替2元组的内容
原文: pair to replace the contents of this 2-tuple |
[编辑] 返回值
*this
[编辑] 例外
1)(无)
2) noexcept specification: (C++11 起)
3-5) noexcept(noexcept( is_nothrow_move_assignable<T0>::value && |
||
(无)
6)
[编辑] 示例
本章尚未完成 原因:暂无示例 |