Skip to content

const_iterator_pro

C++
template < class value_type > class const_iterator_pro; // generic template

Const iterator of vector_pro

You can get one by calling vector_pro::cbegin, vector_pro::cend, vector_pro::crbegin or vector_pro::rend .

The return value will be an const_iterator_pro points to the beginning, end, reverse beginning and reverse end of the of the sequence respectively.

By using the dereference operator * you can access the const data.

Keep in mind that the type of the reverse const iterator is also const_iterator_pro but will move in an opposite way.

Additionally, using const_iterator_pro for any operations or data access will not throw exceptions. Please ensure that memory errors will not occur when using it.

See also iterator_pro .

Member functions

name notes
(constructor) constructor (public member function)
(destructor) destructor (public member function)
C++
// 1.
size_type get_idx() const;

// 2.
value_type** const get_data() const;

// 3.
bool get_reverse_flag() const;

// 4.
const_iterator_pro operator++();
const_iterator_pro operator--();

// 5.
const_iterator_pro operator++(int);
const_iterator_pro operator--(int);

// 6.
const_iterator_pro operator+(const int step);
const_iterator_pro operator-(const int step);

// 7.
bool operator==(const iterator_pro<value_type>& another) const;
bool operator!=(const iterator_pro<value_type>& another) const;

// 8.
const value_type& operator*();
  1. Obtain the index of the data pointed to by const_iterator_pro in its container.
  2. Obtain the data of the container that const_iterator_pro points to.
  3. Whether the iterator is a reverse iterator.
  4. Return itself after moving the const_iterator_pro by one step.
  5. Return itself before moving the const_iterator_pro by one step
  6. Move the const_iterator_pro by a specified number of steps.
  7. Whether the two const_iterator_pros point to the same data.
  8. Access the const data.

If the iterator is a reversed one, both ++ / -- and + / - will move backward / forward .

Note that a vector_pro can convert into a const_iterator_pro , while the opposite is not true.

Example

See more in vector_pro::cbegin, vector_pro::cend, vector_pro::crbegin and vector_pro::rend .