次の方法で共有


operator>= (set)

演算子の左側のオブジェクトが右側の設定セット オブジェクトの値以上でテスト。

bool operator!>=(
   const set <Key, Traits, Allocator>& _Left,
   const set <Key, Traits, Allocator>& _Right
);

パラメーター

  • _Left
    **[設定]**型のオブジェクト。

  • _Right
    **[設定]**型のオブジェクト。

戻り値

演算子の左側のセットがリストの右側の設定の値以上でtrue ; それ false

解説

特定のオブジェクトの比較は、要素のペアに比較に基づいています。大きいまたは 2 個のオブジェクトの関係以上の場合は、最初のペアの付いていない要素の比較に基づいています。

使用例

// set_op_ge.cpp
// compile with: /EHsc
#include <set>
#include <iostream>

int main( )
{
   using namespace std;
   set <int> s1, s2, s3, s4;
   int i;

   for ( i = 0 ; i < 3 ; i++ )
   {
      s1.insert ( i );
      s2.insert ( i * i );
      s3.insert ( i - 1 );
      s4.insert ( i );
   }

   if ( s1 >= s2 )
      cout << "Set s1 is greater than or equal to set s2." << endl;
   else
      cout << "The set s1 is less than the set s2." << endl;

   if ( s1 >= s3 )
      cout << "Set s1 is greater than or equal to set s3." << endl;
   else
      cout << "The set s1 is less than the set s3." << endl;

   if ( s1 >= s4 )
      cout << "Set s1 is greater than or equal to set s4." << endl;
   else
      cout << "The set s1 is less than the set s4." << endl;
}
  
  
  

必要条件

ヘッダー: <set>

名前空間: std

参照

関連項目

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