This topic has not yet been rated - Rate this topic

operator<= (hash_multiset) 

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


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

Parameters

_Left

An object of type hash_multiset.

_Right

An object of type hash_multiset.

true if the hash_multiset on the left side of the operator is less than or equal to the hash_multiset on the right side of the operator; otherwise false.

The comparison between hash_multiset objects is based on a pairwise comparison of their elements. The less 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.

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

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

   if ( hs1 <= hs3 )
      cout << "The hash_multiset hs1 is less than "
           << "or equal to the hash_multiset hs3." << endl;
   else
      cout << "The hash_multiset hs1 is greater than "
           << "the hash_multiset hs3." << endl;

   if ( hs1 <= hs4 )
      cout << "The hash_multiset hs1 is less than "
           << "or equal to the hash_multiset hs4." << endl;
   else
      cout << "The hash_multiset hs1 is greater than "
           << "the hash_multiset hs4." << endl;
}

Output

The hash_multiset hs1 is less than or equal to the hash_multiset hs2.
The hash_multiset hs1 is greater than the hash_multiset hs3.
The hash_multiset hs1 is less than or equal to the hash_multiset hs4.

Header: <hash_set>

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.