次の方法で共有


operator< (<deque>)

演算子の左側の deque のオブジェクトが右側のオブジェクトより小さい deque のテスト。

bool operator<(
   const deque<Type, Allocator>& _Left,
   const deque<Type, Allocator>& _Right
);

パラメーター

  • _Left
    deque 型のオブジェクト。

  • _Right
    deque 型のオブジェクト。

戻り値

演算子の左側の deque がよりも小さいと等しくないと演算子の右側のtrue deque; それ false

解説

deque のオブジェクトの比較は、要素のペアに比較に基づいています。2 種類のオブジェクトの関係も少ない最初のペアの付いていない要素の比較に基づいています。

使用例

// deque_op_lt.cpp
// compile with: /EHsc
#include <deque>
#include <iostream>

int main( ) 
{
   using namespace std; 
   deque <int> c1, c2;

   c1.push_back( 1 );
   c1.push_back( 2 );
   c1.push_back( 4 );

   c2.push_back( 1 );
   c2.push_back( 3 );

   if ( c1 < c2 )
      cout << "Deque c1 is less than deque c2." << endl;
   else
      cout << "Deque c1 is not less than deque c2." << endl;
}
  

必要条件

ヘッダー: <deque>

名前空間: std

参照

関連項目

deque::operator== と deque::operator<

標準テンプレート ライブラリ