pair::operator= (STL/CLR)

替换存储的值对。

    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

请参见

参考

pair (STL/CLR)