operator== (pair) (STL/CLR)
對相等比較。
template<typename Value1,
typename Value2>
bool operator==(pair<Value1, Value2>% left,
pair<Value1, Value2>% right);
參數
left
要比較的左邊。right
要比較的物件。
備註
運算子函式會傳回 left.first == right.first && left.second == right.second。 您會用它來測試在這兩對是項目對項目的比較時, left 是否與 right 排序相同。
範例
// 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);
}
需求
標頭 : <cliext/utility>
命名空間: cliext