共用方式為


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)