operator<= (pair) (STL/CLR)
配對小於或等於比較。
template<typename Value1,
typename Value2>
bool operator<=(pair<Value1, Value2>% left,
pair<Value1, Value2>% right);
參數
left
若要比較的左的組。right
若要比較的權限組。
備註
The operator function returns !(right < left). 您用它來測試是否left未經過排序後right在兩個配對都比較的項目由項目。
範例
// cliext_pair_operator_le.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/公用程式 >
Namespace: cliext