Freigeben über


operator== (pair) (STL/CLR)

 

The latest version of this topic can be found at operator== (pair) (STL/CLR).

Pair equal comparison.

Syntax

template<typename Value1,  
    typename Value2>  
    bool operator==(pair<Value1, Value2>% left,  
        pair<Value1, Value2>% right);  

Parameters

left
Left pair to compare.

right
Right pair to compare.

Remarks

The operator function returns left``.first == right``.first && left``.second == right``.second. You use it to test whether left is ordered the same as right when the two pairs are compared element by element.

Example

// cliext_pair_operator_eq.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);   
    cliext::pair<wchar_t, int> c2(L'x', 4);   
    System::Console::WriteLine("[{0}, {1}]", c2.first, c2.second);   
  
    System::Console::WriteLine("[x 3] == [x 3] is {0}",   
        c1 == c1);   
    System::Console::WriteLine("[x 3] == [x 4] is {0}",   
        c1 == c2);   
    return (0);   
    }  
  
[x, 3]  
[x, 4]  
[x 3] == [x 3] is True  
[x 3] == [x 4] is False  

Requirements

Header: <cliext/utility>

Namespace: cliext

See Also

pair (STL/CLR)
operator!= (pair) (STL/CLR)
operator< (pair) (STL/CLR)
operator>= (pair) (STL/CLR)
operator> (pair) (STL/CLR)
operator<= (pair) (STL/CLR)