pair::operator= (STL/CLR)
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at pair::operator= (STL/CLR).
Replaces the stored pair of values.
Syntax
pair<Value1, Value2>% operator=(pair<Value1, Value2>% right);
Parameters
right
Pair to copy.
Remarks
The member operator copies right
to the object, then returns *this
. You use it to replace the stored pair of values with a copy of the stored pair of values in right
.
Example
// 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);
}
[x, 3]
[x, 3]
Requirements
Header: <cliext/utility>
Namespace: cliext