Aracılığıyla paylaş


operator> (map)

Harita nesnesi işlecinin sol tarafındaki sağ taraftaki harita nesnesi büyükse sınar.

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

Parametreler

  • _Left
    Bir nesne türü Harita.

  • _Right
    Bir nesne türü Harita.

Dönüş Değeri

gerçek işlecinin sol tarafındaki map haritayı; işlecinin sağ tarafındaki büyükse Aksi halde yanlış.

Notlar

Eşlem nesneleri arasında karşılaştırma öðelerinin yapılandırdı Karşılaştırmasında esas alır. Büyük-iki nesne arasındaki ilişki ilk çifti eşit olmayan öğelerin Karşılaştırmasında dayalı çok.

Örnek

// map_op_gt.cpp
// compile with: /EHsc
#include <map>
#include <iostream>

int main( )
{
   using namespace std;
   map < int, int > m1, m2, m3;
   int i;
   typedef pair < int, int > Int_Pair;

   for ( i = 0 ; i < 3 ; i++ )
   {
      m1.insert ( Int_Pair ( i, i ) );
      m2.insert ( Int_Pair ( i, i * i ) );
      m3.insert ( Int_Pair ( i, i - 1 ) );
   }

   if ( m1 > m2 )
      cout << "The map m1 is greater than the map m2." << endl;
   else
      cout << "The map m1 is not greater than the map m2." << endl;

   if ( m1 > m3 )
      cout << "The map m1 is greater than the map m3." << endl;
   else
      cout << "The map m1 is not greater than the map m3." << endl;
}
  
  

Gereksinimler

Başlık: <map>

Namespace: std

Ayrıca bkz.

Başvuru

Standart Şablon Kütüphanesi