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 || !(right.first <left.first &&left.second <right.second。使用该测试 left 是否已订购在 right 之前,在两个对已比较组件的元素。

示例

// cliext_pair_operator_lt.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/实用工具>

命名空间: cliext

请参见

参考

pair (STL/CLR)

operator== (pair) (STL/CLR)

operator!= (pair) (STL/CLR)

operator>= (pair) (STL/CLR)

operator> (pair) (STL/CLR)

operator<= (pair) (STL/CLR)