halcheck 1.0
Loading...
Searching...
No Matches
halcheck::lib::index_iterator< R > Class Template Reference

An iterator into a random-access range that is invalidated if and only if the index of the pointed-to element changes. More...

#include <index.hpp>

Inheritance diagram for halcheck::lib::index_iterator< R >:
halcheck::lib::iterator_interface< index_iterator< R > >

Public Types

using value_type = lib::range_value_t<R>
 The type of value this iterator points to.
 
using reference = lib::range_reference_t<R>
 The type of value returned by operator*.
 
using pointer = void
 This iterator does not support operator->.
 
using difference_type = lib::range_difference_t<R>
 The type of distances between iterators.
 
using iterator_category = std::random_access_iterator_tag
 Indicates that index_iterator is a random-access iterator.
 

Public Member Functions

 index_iterator ()=default
 Constructs a default index_iterator.
 
 index_iterator (R &base, difference_type index=0)
 Constructs an index_iterator pointing into the given range.
 
template<typename T >
 index_iterator (const index_iterator< T > &other)
 Converts between index_iterators.
 
reference operator* () const
 Obtains the element this iterator points to.
 
index_iteratoroperator++ ()
 Advances this iterator.
 
index_iteratoroperator-- ()
 Advances this iterator backwards.
 
index_iteratoroperator+= (difference_type n)
 Advances this iterator by the specified number of steps.
 
difference_type index () const
 Gets the index of the element this iterator points to.
 
constexpr lib::iter_reference_t< I > operator[] (lib::iter_difference_t< I > n) const
 Access the element at the specified index.
 
operator++ (int)
 Advances this iterator.
 
operator-- (int)
 Advances this iterator a step backwards.
 
I & operator-= (lib::iter_difference_t< I > n)
 Advances this iterator the specified number of steps backwards.
 

Friends

bool operator== (const index_iterator &lhs, const index_iterator &rhs)
 Determines if two iterators are equal.
 
difference_type operator- (const index_iterator &lhs, const index_iterator &rhs)
 Computes the distance between two iterators.
 

Detailed Description

template<typename R>
class halcheck::lib::index_iterator< R >

An iterator into a random-access range that is invalidated if and only if the index of the pointed-to element changes.

Template Parameters
RThe type of range to point into.

The documentation for this class was generated from the following file: