次の方法で共有


operator>= (multiset)

演算子の左側のマルチセット オブジェクトが右側のマルチセット オブジェクト以上であるかどうかを調べます。

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

パラメーター

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

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

戻り値

演算子の左側のマルチセットが一覧の右側のマルチセットの値以上であるtrue ; それ false

解説

マルチセット オブジェクトの比較は要素の比較に一対に基づいています。 大きいまたは 2 のオブジェクト間の関係に等号は等しくない要素の最初のペアの比較に基づいています。

使用例

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

int main( )
{
   using namespace std;
   multiset <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 << "The multiset s1 is greater than "
           << "or equal to the multiset s2." << endl;
   else
      cout << "The multiset s1 is less than "
           << "the multiset s2." << endl;

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

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

必要条件

ヘッダー: <set>

名前空間: std

参照

関連項目

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