Share via


operator<= (hash_multimap)

Comprueba si es el objeto de hash_multimap en el lado izquierdo del operador menor o igual que el objeto de hash_multimap en el lado derecho.

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

Parámetros

  • _Left
    Objeto de tipo hash_multimap.

  • _Right
    Objeto de tipo hash_multimap.

Valor devuelto

TRUE si el hash_multimap en el lado izquierdo del operador es menor o igual que el hash_multimap a la derecha del operador; si no Falso.

nota

La comparación entre los objetos de hash_multimap se basa en pares una comparación de sus elementos. Menor o igual que la relación entre dos objetos se basa en una comparación del primer par de elementos distintos.

En Visual C++ .NET 2003, los miembros de los archivos de encabezado de <hash_map> y de <hash_set> ya no están en el espacio de nombres std, pero se han movido bastante al espacio de nombres stdext. Vea El espacio de nombres stdext para obtener más información.

Ejemplo

// hash_multimap_op_le.cpp
// compile with: /EHsc
#define _DEFINE_DEPRECATED_HASH_CLASSES 0
#include <hash_map>
#include <iostream>

int main( )
{
   using namespace std;
   using namespace stdext;
   hash_multimap <int, int> hm1, hm2, hm3, hm4;
   int i;
   typedef pair <int, int> Int_Pair;

   for ( i = 1 ; i < 3 ; i++ )
   {
      hm1.insert ( Int_Pair ( i, i ) );
      hm2.insert ( Int_Pair ( i, i * i ) );
      hm3.insert ( Int_Pair ( i, i - 1 ) );
      hm4.insert ( Int_Pair ( i, i ) );
   }

   if ( hm1 <= hm2 )
      cout << "The hash_multimap hm1 is less than or equal to the hash_multimap hm2." << endl;
   else
      cout << "The hash_multimap hm1 is greater than the hash_multimap hm2." << endl;

   if ( hm1 <= hm3 )
      cout << "The hash_multimap hm1 is less than or equal to the hash_multimap hm3." << endl;
   else
      cout << "The hash_multimap hm1 is greater than the hash_multimap hm3." << endl;

   if ( hm1 <= hm4 )
      cout << "The hash_multimap hm1 is less than or equal to the hash_multimap hm4." << endl;
   else
      cout << "The hash_multimap hm1 is greater than the hash_multimap hm4." << endl;
}
  
  
  

Requisitos

encabezado: <hash_map>

espacio de nombres: stdext

Vea también

Referencia

Biblioteca de plantillas estándar