定义于头文件 <utility>
std::pair 是一个结构体模板,其可于一个单元存储两个相异对象。 pair 是 std::tuple 的拥有两个元素的特殊情况。
对内容赋值
std::pair<T1,T2>::operator=
| pair& operator=( const pair& other ); |
(1) | (C++20 前) |
| constexpr pair& operator=( const pair& other ); |
(C++20 起) | |
| template< class U1, class U2 > |
(2) | (C++20 前) |
| template< class U1, class U2 > |
(C++20 起) | |
| pair& operator=( pair&& other ) noexcept(/* see below */); |

文章详细解释了C++标准库中的std::pair结构体模板的赋值操作符,包括复制赋值、成员赋值、移动赋值以及模板版本的规则和异常处理。
最低0.47元/天 解锁文章
2336

被折叠的 条评论
为什么被折叠?



