Aracılığıyla paylaş


operator> (<iterator>)

Sınamaları Yineleyici işlecinin sol tarafındaki Yineleyici nesneyi sağ tarafındaki büyük 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 Yineleyici deyiminin sol tarafındaki ifade; sağ tarafında Yineleyici büyükse yanlış Yineleyici sağdaki küçük veya eşit olması durumunda.

Notlar

Kapsayıcı Yineleyici nesnesi tarafından gönderilen öğeyi daha ilerisindeki oluşan bir öğe adresleri değişirse bir yineleyici baþka birinden büyük nesnesidir.Bir yineleyici nesnesi Yineleyici nesneyle aynı öğe veya kapsayıcı Yineleyici nesnesi tarafından gönderilen öğeyi daha önceki bölümlerinde yer alan oluşan bir öğe adresleri değişirse baþka birinden büyük değil.

Örnek

// iterator_op_gt.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 ( );
   
   cout << "The iterators rVPOS1 & rVPOS2 initially point to "
           << "the first element\n in the reversed sequence: "
           << *rVPOS1 << "." << endl;

   if ( rVPOS1 > rVPOS2 )
      cout << "The iterator rVPOS1 is greater than "
              << "the iterator rVPOS2." << endl;
   else
      cout << "The iterator rVPOS1 is less than or "
              << "equal to 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 "
              << "the iterator rVPOS2." << endl;
   else
      cout << "The iterator rVPOS1 is less than or "
              << "equal to the iterator rVPOS2." << endl;
}
  
  
  
  
  

Gereksinimler

Başlık: <iterator>

Namespace: std

Ayrıca bkz.

Başvuru

Standart Şablon Kütüphanesi