Skip to content

iterator_pro

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

Iterator of vector_pro

You can get one by calling vector_pro::begin, vector_pro::end, vector_pro::rbegin or vector_pro::rend .

The return value will be an 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 data.

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

Also note that iterator_pro and std::iterator are not compatible.

Additionally, using 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 const_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.
iterator_pro operator++();
iterator_pro operator--();

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

// 6.
iterator_pro operator+(const int step);
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.
value_type& operator*();
  1. Obtain the index of the data pointed to by iterator_pro in its container.
  2. Obtain the data of the container that iterator_pro points to.
  3. Whether the iterator is a reverse iterator.
  4. Return itself after moving the iterator_pro by one step.
  5. Return itself before moving the iterator_pro by one step
  6. Move the iterator_pro by a specified number of steps.
  7. Whether the two iterator_pros point to the same data.
  8. Access the data.

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

Example

See more in vector_pro::begin, vector_pro::end, vector_pro::rbegin and vector_pro::rend .