替换存储对的值。
pair<Value1, Value2>% operator=(pair<Value1, Value2>% right);
参数
- right
对复制的。
备注
运算符将 right 对该对象的成员,然后返回 *this。 使用它用存储对的副本替换存储的值对 right中的值。
示例
// cliext_pair_operator_as.cpp
// compile with: /clr
#include <cliext/utility>
int main()
{
cliext::pair<wchar_t, int> c1(L'x', 3);
System::Console::WriteLine("[{0}, {1}]", c1.first, c1.second);
// assign to a new pair
cliext::pair<wchar_t, int> c2;
c2 = c1;
System::Console::WriteLine("[{0}, {1}]", c2.first, c2.second);
return (0);
}
要求
页眉: </cliext 实用工具>
命名空间: cliext