Aracılığıyla paylaş


checked_array_iterator Sınıfı

sınıfı, checked_array_iterator bir diziyi veya işaretçiyi denetlenmiş bir yineleyiciye dönüştürmenize olanak tanır. Bu sınıfı ham işaretçiler veya diziler için sarmalayıcı olarak (make_checked_array_iterator işlevini kullanarak) bu uyarıları genel olarak susturmak yerine denetimi sağlamanın ve işaretlenmemiş işaretçi uyarılarını yönetmenin hedeflenen bir yolu olarak kullanın. Gerekirse, bu sınıfın işaretsiz sürümünü unchecked_array_iterator kullanabilirsiniz.

Not

Bu sınıf, C++ Standart Kitaplığı'nın bir Microsoft uzantısıdır. Bu işlev kullanılarak uygulanan kod bu Microsoft uzantısını desteklemeyen C++ Standart yapı ortamları için taşınabilir değildir. Örneğin, bu sınıfın kullanımını gerektirmeyen kodun nasıl yazılacağını gösteren bir örnek için, aşağıdaki ikinci örneğe bakın.

Sözdizimi

template <class _Iterator>
class checked_array_iterator;

Açıklamalar

Bu sınıf stdext ad alanında tanımlanır.

denetlenen yineleyici özelliği hakkında daha fazla bilgi ve örnek kod için bkz . İşaretli Yineleyiciler.

Örnekler

Aşağıdaki örnek denetlenen bir dizi yineleyicisinin nasıl tanımlanacağını ve kullanılacağını göstermektedir.

Hedef kopyalanan öğeleri tutmak için yeterince büyük değilse, satırı değiştirdiyseniz duruma göre şöyle olur:

copy(a, a + 5, checked_array_iterator<int*>(b, 5));

kullanıcısı

copy(a, a + 5, checked_array_iterator<int*>(b, 4));

Bir çalışma zamanı hatası oluşur.

// compile with: /EHsc /W4 /MTd
#include <algorithm>
#include <iostream>

using namespace std;
using namespace stdext;

int main() {
   int a[]={0, 1, 2, 3, 4};
   int b[5];
   copy(a, a + 5, checked_array_iterator<int*>(b, 5));

   cout << "(";
   for (int i = 0 ; i < 5 ; i++)
      cout << " " << b[i];
   cout << " )" << endl;

   // constructor example
   checked_array_iterator<int*> checked_out_iter(b, 5);
   copy(a, a + 5, checked_out_iter);

   cout << "(";
   for (int i = 0 ; i < 5 ; i++)
      cout << " " << b[i];
   cout << " )" << endl;
}
/* Output:
( 0 1 2 3 4 )
( 0 1 2 3 4 )
*/

C++ Standart Kitaplığı algoritmalarını kullanırken sınıfın checked_array_iterator gereksinimini önlemek için dinamik olarak ayrılmış bir dizi yerine bir vector kullanmayı göz önünde bulundurun. Aşağıdaki örnek bunun nasıl yapılacağını göstermektedir.

// compile with: /EHsc /W4 /MTd

#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    std::vector<int> v(10);
    int *arr = new int[10];
    for (int i = 0; i < 10; ++i)
    {
        v[i] = i;
        arr[i] = i;
    }

    // std::copy(v.begin(), v.end(), arr); will result in
    // warning C4996. To avoid this warning while using int *,
    // use the Microsoft extension checked_array_iterator.
    std::copy(v.begin(), v.end(),
              stdext::checked_array_iterator<int *>(arr, 10));

    // Instead of using stdext::checked_array_iterator and int *,
    // consider using std::vector to encapsulate the array. This will
    // result in no warnings, and the code will be portable.
    std::vector<int> arr2(10);    // Similar to int *arr = new int[10];
    std::copy(v.begin(), v.end(), arr2.begin());

    for (int j = 0; j < arr2.size(); ++j)
    {
        cout << " " << arr2[j];
    }
    cout << endl;

    return 0;
}
/* Output:
0 1 2 3 4 5 6 7 8 9
*/

Oluşturucular

Oluşturucu Açıklama
checked_array_iterator Temel alınan bir yineleyiciden varsayılan checked_array_iterator veya checked_array_iterator bir oluşturur.

Tür tanımları

Tür adı Açıklama
difference_type Aynı kapsayıcı içindeki öğelere başvuran iki checked_array_iteratoröğe arasındaki farkı sağlayan bir tür.
Işaretçi tarafından adreslenen bir öğeye işaretçi sağlayan tür checked_array_iterator.
referans tarafından ele alınan bir öğeye başvuru sağlayan bir checked_array_iteratortür.

Üye işlevleri

Üye işlevi Açıklama
temel Temel alınan yineleyiciyi konumundan checked_array_iteratorkurtarır.

İşleçler

Operator Açıklama
operator== Eşitlik için iki checked_array_iterators test.
operator!= Eşitsizlik için iki checked_array_iterators test.
operator< İşlecin checked_array_iterator sol tarafındaki öğesinin sağ taraftakinden checked_array_iterator küçük olup olmadığını sınar.
operator> İşlecin checked_array_iterator sol tarafındaki öğesinin sağ taraftakinden checked_array_iterator büyük olup olmadığını sınar.
operator<= İşlecin checked_array_iterator sol tarafındaki öğesinin sağ taraftakinden checked_array_iterator küçük veya buna eşit olup olmadığını sınar.
operator>= İşlecin checked_array_iterator sol tarafındaki öğesinin sağ taraftakinden büyük veya buna eşit checked_array_iterator olup olmadığını sınar.
operatör* Bir checked_array_iterator adresle ilgili öğesini döndürür.
operatör-> tarafından checked_array_iteratoradreslenen öğeye yönelik bir işaretçi döndürür.
operator++ öğesini checked_array_iterator sonraki öğeye artırır.
operatör-- checked_array_iterator öğesini önceki öğeye geri alır.
operator+= bir öğesine checked_array_iteratorbelirtilen uzaklığı ekler.
işleç+ Yineleyiciye bir uzaklık ekler ve eklenen öğeyi yeni checked_array_iterator uzaklık konumunda adresleyen yeni öğesini döndürür.
operator-= Belirtilen uzaklığı bir checked_array_iterator'den kaldırır.
operatör- Bir yineleyiciden uzaklığı azaltma ve yeni uzaklık konumunda eklenen öğeyi adresleyen yeni checked_array_iterator öğeyi döndürür.
operator[] Belirtilen sayıda konum tarafından adreslenen checked_array_iterator öğeden bir öğe uzaklığı başvurusu döndürür.

Gereksinimler

Üst bilgi:<yineleyici>

Ad alanı: stdext

checked_array_iterator::base

Temel alınan yineleyiciyi konumundan checked_array_iteratorkurtarır.

_Iterator base() const;

Açıklamalar

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

Örnek

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

int main() {
   using namespace std;

   int V1[10];

   for (int i = 0; i < 10 ; i++)
      V1[i] = i;

   int* bpos;

   stdext::checked_array_iterator<int*> rpos(V1, 10);
   rpos++;

   bpos = rpos.base ( );
   cout << "The iterator underlying rpos is bpos & it points to: "
        << *bpos << "." << endl;
}
/* Output:
The iterator underlying rpos is bpos & it points to: 1.
*/

checked_array_iterator::checked_array_iterator

Temel alınan bir yineleyiciden varsayılan checked_array_iterator veya checked_array _iterator bir oluşturur.

checked_array_iterator();

checked_array_iterator(
    ITerator ptr,
    size_t size,
    size_t index = 0);

Parametreler

ptr
Dizi işaretçisi.

boyut
Dizinin boyutu.

Dizin
(İsteğe bağlı) Yineleyiciyi başlatmak için dizideki bir öğe. Varsayılan olarak, yineleyici dizideki ilk öğeye başlatılır.

Açıklamalar

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

Örnek

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

using namespace std;
using namespace stdext;

int main() {
   int a[] = {0, 1, 2, 3, 4};
   int b[5];
   copy(a, a + 5, checked_array_iterator<int*>(b,5));

   for (int i = 0 ; i < 5 ; i++)
      cout << b[i] << " ";
   cout << endl;

   checked_array_iterator<int*> checked_output_iterator(b,5);
   copy (a, a + 5, checked_output_iterator);
   for (int i = 0 ; i < 5 ; i++)
      cout << b[i] << " ";
   cout << endl;

   checked_array_iterator<int*> checked_output_iterator2(b,5,3);
   cout << *checked_output_iterator2 << endl;
}
/* Output:
0 1 2 3 4
0 1 2 3 4
3
*/

checked_array_iterator::d ifference_type

Aynı kapsayıcı içindeki öğelere başvuran iki checked_array_iteratoröğe arasındaki farkı sağlayan bir tür.

typedef typename iterator_traits<_Iterator>::difference_type difference_type;

Açıklamalar

Fark checked_array_iterator türü yineleyici fark türüyle aynıdır.

Kod örneği için bkz . checked_array_iterator::operator[] .

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

checked_array_iterator::operator==

Eşitlik için iki checked_array_iterators test.

bool operator==(const checked_array_iterator<_Iterator>& right) const;

Parametreler

Sağ
Eşitliğin checked_array_iterator denetlendiği değer.

Açıklamalar

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

Örnek

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

using namespace std;
using namespace stdext;

int main() {
   int a[] = {0, 1, 2, 3, 4};
   int b[5];
   copy(a, a + 5, checked_array_iterator<int*>(b,5));
   copy(a, a + 5, checked_array_iterator<int*>(b,5));

   checked_array_iterator<int*> checked_output_iterator(b,5);
   checked_array_iterator<int*> checked_output_iterator2(b,5);

   if (checked_output_iterator2 == checked_output_iterator)
      cout << "checked_array_iterators are equal" << endl;
   else
      cout << "checked_array_iterators are not equal" << endl;

   copy (a, a + 5, checked_output_iterator);
   checked_output_iterator++;

   if (checked_output_iterator2 == checked_output_iterator)
      cout << "checked_array_iterators are equal" << endl;
   else
      cout << "checked_array_iterators are not equal" << endl;
}
/* Output:
checked_array_iterators are equal
checked_array_iterators are not equal
*/

checked_array_iterator::operator!=

Eşitsizlik için iki checked_array_iterators test.

bool operator!=(const checked_array_iterator<_Iterator>& right) const;

Parametreler

Sağ
Eşitsizliğin checked_array_iterator denetlendiği.

Açıklamalar

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

Örnek

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

using namespace std;
using namespace stdext;

int main() {
   int a[] = {0, 1, 2, 3, 4};
   int b[5];
   copy(a, a + 5, checked_array_iterator<int*>(b,5));
   copy(a, a + 5, checked_array_iterator<int*>(b,5));

   checked_array_iterator<int*> checked_output_iterator(b,5);
   checked_array_iterator<int*> checked_output_iterator2(b,5);

   if (checked_output_iterator2 != checked_output_iterator)
      cout << "checked_array_iterators are not equal" << endl;
   else
      cout << "checked_array_iterators are equal" << endl;

   copy (a, a + 5, checked_output_iterator);
   checked_output_iterator++;

   if (checked_output_iterator2 != checked_output_iterator)
      cout << "checked_array_iterators are not equal" << endl;
   else
      cout << "checked_array_iterators are equal" << endl;
}
/* Output:
checked_array_iterators are equal
checked_array_iterators are not equal
*/

checked_array_iterator::operator<

İşlecin checked_array_iterator sol tarafındaki öğesinin sağ taraftakinden checked_array_iterator küçük olup olmadığını sınar.

bool operator<(const checked_array_iterator<_Iterator>& right) const;

Parametreler

Sağ
Eşitsizliğin checked_array_iterator denetlendiği.

Açıklamalar

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

Örnek

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

using namespace std;
using namespace stdext;

int main() {
   int a[] = {0, 1, 2, 3, 4};
   int b[5];
   copy(a, a + 5, checked_array_iterator<int*>(b,5));
   copy(a, a + 5, checked_array_iterator<int*>(b,5));

   checked_array_iterator<int*> checked_output_iterator(b,5);
   checked_array_iterator<int*> checked_output_iterator2(b,5);

   if (checked_output_iterator2 < checked_output_iterator)
      cout << "checked_output_iterator2 is less than checked_output_iterator" << endl;
   else
      cout << "checked_output_iterator2 is not less than checked_output_iterator" << endl;

   copy (a, a + 5, checked_output_iterator);
   checked_output_iterator++;

   if (checked_output_iterator2 < checked_output_iterator)
      cout << "checked_output_iterator2 is less than checked_output_iterator" << endl;
   else
      cout << "checked_output_iterator2 is not less than checked_output_iterator" << endl;
}
/* Output:
checked_output_iterator2 is not less than checked_output_iterator
checked_output_iterator2 is less than checked_output_iterator
*/

checked_array_iterator::operator>

İşlecin checked_array_iterator sol tarafındaki öğesinin sağ taraftakinden checked_array_iterator büyük olup olmadığını sınar.

bool operator>(const checked_array_iterator<_Iterator>& right) const;

Parametreler

Sağ
Karşılaştıracak checked_array_iterator .

Açıklamalar

Kod örneği için bkz checked_array_iterator::operator< .

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

checked_array_iterator::operator<=

İşlecin checked_array_iterator sol tarafındaki öğesinin sağ taraftakinden checked_array_iterator küçük veya buna eşit olup olmadığını sınar.

bool operator<=(const checked_array_iterator<_Iterator>& right) const;

Parametreler

Sağ
Karşılaştıracak checked_array_iterator .

Açıklamalar

Kod örneği için bkz checked_array_iterator::operator>= .

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

checked_array_iterator::operator>=

İşlecin checked_array_iterator sol tarafındaki öğesinin sağ taraftakinden büyük veya buna eşit checked_array_iterator olup olmadığını sınar.

bool operator>=(const checked_array_iterator<_Iterator>& right) const;

Parametreler

Sağ
Karşılaştıracak checked_array_iterator .

Açıklamalar

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

Örnek

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

using namespace std;
using namespace stdext;

int main() {
   int a[] = {0, 1, 2, 3, 4};
   int b[5];
   copy(a, a + 5, checked_array_iterator<int*>(b,5));
   copy(a, a + 5, checked_array_iterator<int*>(b,5));

   checked_array_iterator<int*> checked_output_iterator(b,5);
   checked_array_iterator<int*> checked_output_iterator2(b,5);

   if (checked_output_iterator2 >= checked_output_iterator)
      cout << "checked_output_iterator2 is greater than or equal to checked_output_iterator" << endl;
   else
      cout << "checked_output_iterator2 is less than checked_output_iterator" << endl;

   copy (a, a + 5, checked_output_iterator);
   checked_output_iterator++;

   if (checked_output_iterator2 >= checked_output_iterator)
      cout << "checked_output_iterator2 is greater than or equal to checked_output_iterator" << endl;
   else
      cout << "checked_output_iterator2 is less than checked_output_iterator" << endl;
}
/* Output:
checked_output_iterator2 is greater than or equal to checked_output_iterator
checked_output_iterator2 is less than checked_output_iterator
*/

checked_array_iterator::operator*

Bir checked_array_iterator adresle ilgili öğesini döndürür.

reference operator*() const;

Dönüş Değeri

tarafından ele alınan öğesinin checked_array_iteratordeğeri.

Açıklamalar

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

Örnek

// checked_array_iterator_pointer.cpp
// compile with: /EHsc
#include <iterator>
#include <algorithm>
#include <vector>
#include <utility>
#include <iostream>

using namespace std;
using namespace stdext;

int main() {
   int a[] = {0, 1, 2, 3, 4};
   int b[5];
   pair<int, int> c[1];
   copy(a, a + 5, checked_array_iterator<int*>(b,5));

   for (int i = 0 ; i < 5 ; i++)
      cout << b[i] << endl;

    c[0].first = 10;
    c[0].second = 20;

   checked_array_iterator<int*> checked_output_iterator(b,5);
   checked_array_iterator<int*>::pointer p = &(*checked_output_iterator);
   checked_array_iterator<pair<int, int>*> chk_c(c, 1);
   checked_array_iterator<pair<int, int>*>::pointer p_c = &(*chk_c);

   cout << "b[0] = " << *p << endl;
   cout << "c[0].first = " << p_c->first << endl;
}
/* Output:
0
1
2
3
4
b[0] = 0
c[0].first = 10
*/

checked_array_iterator::operator->

tarafından checked_array_iteratoradreslenen öğeye yönelik bir işaretçi döndürür.

pointer operator->() const;

Dönüş Değeri

tarafından adreslenen öğesinin işaretçisi checked_array_iterator.

Açıklamalar

Kod örneği için bkz . checked_array_iterator::p ointer .

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

checked_array_iterator::operator++

öğesini checked_array_iterator sonraki öğeye artırır.

checked_array_iterator& operator++();

checked_array_iterator<_Iterator> operator++(int);

Dönüş Değeri

İlk işleç, öncremented checked_array_iterator değerini döndürür ve ikincisi olan postincrement işleci, artımlı checked_array_iteratoröğesinin bir kopyasını döndürür.

Açıklamalar

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

Örnek

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

int main() {
   using namespace stdext;
   using namespace std;
   int a[] = {6, 3, 77, 199, 222};
   int b[5];
   copy(a, a + 5, checked_array_iterator<int*>(b,5));

   checked_array_iterator<int*> checked_output_iterator(b,5);

   cout << *checked_output_iterator << endl;
   ++checked_output_iterator;
   cout << *checked_output_iterator << endl;
   checked_output_iterator++;
   cout << *checked_output_iterator << endl;
}
/* Output:
6
3
77
*/

checked_array_iterator::operator--

checked_array_iterator öğesini önceki öğeye geri alır.

checked_array_iterator<_Iterator>& operator--();

checked_array_iterator<_Iterator> operator--(int);

Dönüş Değeri

İlk işleç önceden checked_array_iterator belirlenmiş ve ikincisi olan postdecrement işleci, azalan checked_array_iteratordeğerinin bir kopyasını döndürür.

Açıklamalar

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

Örnek

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

int main() {
   using namespace stdext;
   using namespace std;
   int a[] = {6, 3, 77, 199, 222};
   int b[5];
   copy(a, a + 5, checked_array_iterator<int*>(b,5));

   checked_array_iterator<int*> checked_output_iterator(b,5);

   cout << *checked_output_iterator << endl;
   checked_output_iterator++;
   cout << *checked_output_iterator << endl;
   checked_output_iterator--;
   cout << *checked_output_iterator << endl;
}
/* Output:
6
3
6
*/

checked_array_iterator::operator+=

bir öğesine checked_array_iteratorbelirtilen uzaklığı ekler.

checked_array_iterator<_Iterator>& operator+=(difference_type _Off);

Parametreler

_Kapalı
Yineleyicinin artırıldığı uzaklık.

Dönüş Değeri

tarafından ele alınan öğesine başvuru checked_array_iterator.

Açıklamalar

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

Örnek

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

int main() {
   using namespace stdext;
   using namespace std;
   int a[] = {6, 3, 77, 199, 222};
   int b[5];
   copy(a, a + 5, checked_array_iterator<int*>(b,5));

   checked_array_iterator<int*> checked_output_iterator(b,5);

   cout << *checked_output_iterator << endl;
   checked_output_iterator += 3;
   cout << *checked_output_iterator << endl;
}
/* Output:
6
199
*/

checked_array_iterator::operator+

Yineleyiciye bir uzaklık ekler ve eklenen öğeyi yeni checked_array_iterator uzaklık konumunda adresleyen yeni öğesini döndürür.

checked_array_iterator<_Iterator> operator+(difference_type _Off) const;

Parametreler

_Kapalı
öğesine eklenecek checked_array_iteratoruzaklık.

Dönüş Değeri

checked_array_iterator Uzaklık öğesini ele alan bir.

Açıklamalar

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

Örnek

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

int main() {
   using namespace stdext;
   using namespace std;
   int a[] = {6, 3, 77, 199, 222};
   int b[5];
   copy(a, a + 5, checked_array_iterator<int*>(b,5));

   checked_array_iterator<int*> checked_output_iterator(b,5);

   cout << *checked_output_iterator << endl;
   checked_output_iterator = checked_output_iterator + 3;
   cout << *checked_output_iterator << endl;
}
/* Output:
6
199
*/

checked_array_iterator::operator-=

Belirtilen uzaklığı bir checked_array_iterator'den kaldırır.

checked_array_iterator<_Iterator>& operator-=(difference_type _Off);

Parametreler

_Kapalı
Yineleyicinin artırıldığı uzaklık.

Dönüş Değeri

tarafından ele alınan öğesine başvuru checked_array_iterator.

Açıklamalar

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

Örnek

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

int main() {
   using namespace stdext;
   using namespace std;
   int a[] = {6, 3, 77, 199, 222};
   int b[5];
   copy(a, a + 5, checked_array_iterator<int*>(b,5));

   checked_array_iterator<int*> checked_output_iterator(b,5);

   checked_output_iterator += 3;
   cout << *checked_output_iterator << endl;
   checked_output_iterator -= 2;
   cout << *checked_output_iterator << endl;
}
/* Output:
199
3
*/

checked_array_iterator::operator-

Bir yineleyiciden uzaklığı azaltma ve yeni uzaklık konumunda eklenen öğeyi adresleyen yeni checked_array_iterator öğeyi döndürür.

checked_array_iterator<_Iterator> operator-(difference_type _Off) const;

difference_type operator-(const checked_array_iterator& right) const;

Parametreler

_Kapalı
'den checked_array_iteratorkaldırılacak uzaklık.

Dönüş Değeri

checked_array_iterator Uzaklık öğesini ele alan bir.

Açıklamalar

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

checked_array_iterator::operator[]

Belirtilen sayıda konum tarafından adreslenen checked_array_iterator öğeden bir öğe uzaklığı başvurusu döndürür.

reference operator[](difference_type _Off) const;

Parametreler

_Kapalı
Adresten uzaklık checked_array_iterator .

Dönüş Değeri

Öğe uzaklığı başvurusu.

Açıklamalar

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

Örnek

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

int main() {
   using namespace std;
   int V1[10];

   for (int i = 0; i < 10 ; i++)
      V1[i] = i;

   // Declare a difference type for a parameter
   stdext::checked_array_iterator<int*>::difference_type diff = 2;

   stdext::checked_array_iterator<int*> VChkIter(V1, 10);

   stdext::checked_array_iterator<int*>::reference refrpos = VChkIter [diff];

   cout << refrpos + 1 << endl;
}
/* Output:
3
*/

checked_array_iterator::p ointer

tarafından adreslenen bir öğeye işaretçi sağlayan tür checked_array_iterator.

typedef typename iterator_traits<_Iterator>::pointer pointer;

Açıklamalar

Kod örneği için bkz . checked_array_iterator::operator* .

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

checked_array_iterator::reference

tarafından ele alınan bir öğeye başvuru sağlayan bir checked_array_iteratortür.

typedef typename iterator_traits<_Iterator>::reference reference;

Açıklamalar

Kod örneği için bkz . checked_array_iterator::operator[] .

Daha fazla bilgi için bkz . İşaretli Yineleyiciler.

Ayrıca bkz.

<Yineleyici>
C++ Standart Kitaplığı Başvurusu