次の方法で共有


operator< (list) (STL/CLR)

リスト比較より小さい。

template<typename Value>
    bool operator<(list<Value>% left,
        list<Value>% right);

パラメーター

  • [left]
    比較の左辺のコンテナー。

  • [right]
    比較の右辺のコンテナー。

解説

演算子関数の戻り値は !(right[i] < left[i]) がその満たすこと left[i] < right[i] 最低位置 i では調整します。それ以外の場合は、 2 種類の一覧が要素によって比較された要素の場合 left は right の前に順序付けされているかどうかをテストするときに使用する left->size() <right->size() を返します。

使用例

// cliext_list_operator_lt.cpp 
// compile with: /clr 
#include <cliext/list> 
 
int main() 
    { 
    cliext::list<wchar_t> c1; 
    c1.push_back(L'a'); 
    c1.push_back(L'b'); 
    c1.push_back(L'c'); 
 
// display contents " a b c" 
    for each (wchar_t elem in c1) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// assign to a new container 
    cliext::list<wchar_t> c2; 
    c2.push_back(L'a'); 
    c2.push_back(L'b'); 
    c2.push_back(L'd'); 
 
// display contents " a b d" 
    for each (wchar_t elem in c2) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
    System::Console::WriteLine("[a b c] < [a b c] is {0}", 
        c1 < c1); 
    System::Console::WriteLine("[a b c] < [a b d] is {0}", 
        c1 < c2); 
    return (0); 
    } 
 
  

必要条件

ヘッダー:<cliext/リスト>

名前空間: の cliext

参照

関連項目

list (STL/CLR)

operator== (list) (STL/CLR)

operator!= (list) (STL/CLR)

operator>= (list) (STL/CLR)

operator> (list) (STL/CLR)

operator<= (list) (STL/CLR)