Aracılığıyla paylaş


operator< (set)

Sınamaları işlecinin sol tarafındaki set nesne kümesi nesnesini sağ tarafındaki azdır.

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

Parametreler

  • _Left
    Bir nesne türü set.

  • _Right
    Bir nesne türü set.

Dönüş Değeri

gerçek işlecinin sol tarafındaki set set; işlecinin sağ tarafındaki kesinlikle az ise Aksi halde yanlış.

Notlar

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

Örnek

// set_op_lt.cpp
// compile with: /EHsc
#include <set>
#include <iostream>

int main( )
{
   using namespace std;
   set <int> s1, s2, s3;
   int i;

   for ( i = 0 ; i < 3 ; i++ )
   {
      s1.insert ( i );
      s2.insert ( i * i );
      s3.insert ( i - 1 );
   }

   if ( s1 < s2 )
      cout << "The set s1 is less than the set s2." << endl;
   else
      cout << "The set s1 is not less than the set s2." << endl;

   if ( s1 < s3 )
      cout << "The set s1 is less than the set s3." << endl;
   else
      cout << "The set s1 is not less than the set s3." << endl;
}
  
  

Gereksinimler

Başlık: <set>

Namespace: std

Ayrıca bkz.

Başvuru

Standart Şablon Kütüphanesi