次の方法で共有


operator>= (hash_set)

Tests if the hash_set object on the left side of the operator is greater than or equal to the hash_set object on the right side.

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

Parameters

  • _Left
    An object of type hash_set.

  • _Right
    An object of type hash_set.

Return Value

true if the hash_set on the left side of the operator is greater than or equal to the hash_set on the right side of the list; otherwise false.

Remarks

The comparison between hash_set objects is based on a pairwise comparison of their elements. The greater than or equal to relationship between two objects is based on a comparison of the first pair of unequal elements.

In Visual C++ .NET 2003, members of the <hash_map> and <hash_set> header files are no longer in the std namespace, but rather have been moved into the stdext namespace. See The stdext Namespace for more information.

Example

// hash_set_op_ge.cpp
// compile with: /EHsc
#define _DEFINE_DEPRECATED_HASH_CLASSES 0
#include <hash_set>
#include <iostream>

int main( ) 
{
   using namespace std;
   using namespace stdext;
   hash_set <int> hs1, hs2, hs3, hs4;
   int i;

   for ( i = 0 ; i < 3 ; i++ )
   {
      hs1.insert ( i );
      hs2.insert ( i * i );
      hs3.insert ( i - 1 );
      hs4.insert ( i );
   }

   if ( hs1 >= hs2 )
      cout << "hs1 greater than or equal to hs2" << endl;
   else
      cout << "hs1 less than hs2" << endl;

   if ( hs1 >= hs3 )
      cout << "hs1 greater than or equal to hs3" << endl;
   else
      cout << "hs1 less than hs3" << endl;

   if ( hs1 >= hs4 )
      cout << "hs1 greater than or equal to hs4" << endl;
   else
      cout << "hs1 less than hs4" << endl;
}

hs1 less than hs2
hs1 greater than or equal to hs3
hs1 greater than or equal to hs4

Requirements

Header: <hash_set>

Namespace: stdext

See Also

Concepts

<hash_set> Members

Standard Template Library