Condividi tramite


operator>= (multiset)

Test se l'oggetto di multi-insieme a sinistra dell'operatore è maggiore o uguale all'oggetto di multi-insieme a destra.

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

Parametri

  • _Left
    Oggetto di tipo multiset.

  • _Right
    Oggetto di tipo multiset.

Valore restituito

true se il multi-insieme a sinistra dell'operatore è maggiore o uguale a multi-insieme sul lato destro dell'elenco, in caso contrario false.

Note

Il confronto tra oggetti di multi-insieme è basato pairwise su un confronto dei relativi elementi.Maggiore o uguale alla relazione tra due oggetti è basata su un confronto della prima coppia di elementi diversi.

Esempio

// 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;
}
  
  
  

Requisiti

intestazione: <set>

Spazio dei nomi: deviazione standard

Vedere anche

Riferimenti

Libreria di modelli standard