Aracılığıyla paylaş


operator>= (<iterator>)

Sınamaları Yineleyici işlecinin sol tarafındaki büyük veya eşit sağ tarafındaki Yineleyici nesnesine nesnesidir.

template<class RandomIterator>
   bool operator>=(
      const reverse_iterator<RandomIterator>& _Left,
      const reverse_iterator<RandomIterator>& _Right
   );

Parametreler

  • _Left
    Tür Yineleyici bir nesne.

  • _Right
    Tür Yineleyici bir nesne.

Dönüş Değeri

gerçek deyiminin sol tarafındaki Yineleyici Yineleyici ifade; sağ tarafında eşit veya büyük olması durumunda yanlış sağdaki Yineleyici daha az ise.

Notlar

Aynı öğe ya da daha sonra kapsayıcısında Yineleyici nesnesi tarafından gönderilen öğe'den oluşan bir öğe adresleri değişirse bir yineleyici büyüktür veya eşittir başka bir nesnedir.Kapsayıcı Yineleyici nesnesi tarafından gönderilen öğeyi daha önceki bölümlerinde yer alan oluşan bir öğe adresleri değişirse bir yineleyici nesne başka azdır.

Örnek

// iterator_op_ge.cpp
// compile with: /EHsc
#include <iterator>
#include <vector>
#include <iostream>

int main( )
{
   using namespace std;
   int i;

   vector<int> vec;
   for (i = 0 ; i < 6 ; ++i )  {
      vec.push_back ( 2 * i );
      }
   
   vector <int>::iterator vIter;

   cout << "The initial vector vec is: ( ";
   for ( vIter = vec.begin( ) ; vIter != vec.end( ); vIter++)
      cout << *vIter << " ";
   cout << ")." << endl;

   vector <int>::reverse_iterator rVPOS1 = vec.rbegin ( ), 
           rVPOS2 = vec.rbegin ( ) + 1;
   
   cout << "The iterator rVPOS1 initially points to the "
           << "first element\n in the reversed sequence: "
           << *rVPOS1 << "." << endl;

   cout << "The iterator rVPOS2 initially points to the "
           << "second element\n in the reversed sequence: "
           << *rVPOS2 << "." << endl;

   if ( rVPOS1 >= rVPOS2 )
      cout << "The iterator rVPOS1 is greater than or "
              << "equal to the iterator rVPOS2." << endl;
   else
      cout << "The iterator rVPOS1 is less than "
              << "the iterator rVPOS2." << endl;

   rVPOS1++;
   cout << "The iterator rVPOS1 now points to the second "
           << "element\n in the reversed sequence: "
           << *rVPOS1 << "." << endl;

   if ( rVPOS1 >= rVPOS2 )
      cout << "The iterator rVPOS1 is greater than or "
              << "equal to the iterator rVPOS2." << endl;
   else
      cout << "The iterator rVPOS1 is less than "
              << "the iterator rVPOS2." << endl;
}
  
  
  
  
  
  

Gereksinimler

Başlık: <iterator>

Namespace: std

Ayrıca bkz.

Başvuru

Standart Şablon Kütüphanesi