对大于比较。
template<typename Value1,
typename Value2>
bool operator>(pair<Value1, Value2>% left,
pair<Value1, Value2>% right);
参数
left
比较的左上角对。right
比较的正确对。
备注
运算符函数返回 right < left。 您可用它测试 left 是否在 right 后排序,当两对是比较的元素由元素。
示例
// cliext_pair_operator_gt.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 4] > [x 3] is {0}",
c2 > c1);
return (0);
}
要求
页眉: </cliext 实用工具>
命名空间: cliext