Calico
 All Classes Namespaces Files Functions Variables Typedefs Friends Groups
cal::integer_iterator< T, Tag > Struct Template Reference

An RandomAccessIterator that stores an integer value of type T. The dereferenced value of the iterator is the integer itself. More...

#include <iterator.hpp>

Public Types

typedef value_type difference_type
 Difference_type.
 
typedef
std::random_access_iterator_tag 
iterator_category
 Iterator category.
 
typedef const value_typepointer
 Pointer type.
 
typedef const value_typereference
 Reference type.
 
typedef T value_type
 Value type.
 

Public Member Functions

 integer_iterator (value_type i=value_type())
 Constructs an iterator with the given value.
 
bool operator!= (const integer_iterator &other) const
 Compares the value of the iterators.
 
reference operator* () const
 Returns the integer value of the iterator.
 
integer_iteratoroperator++ ()
 Pre-increments the value of the iterator.
 
integer_iterator operator++ (int)
 Post-increments the value of the iterator.
 
integer_iteratoroperator+= (const difference_type &n)
 Increases the value of the iterator.
 
integer_iteratoroperator-- ()
 Pre-decrements the value of the iterator.
 
integer_iterator operator-- (int)
 Post-decrements the value of the iterator.
 
integer_iteratoroperator-= (const difference_type &n)
 Decreases the value of the iterator.
 
pointer operator-> () const
 Member access of the object pointed to by the iterator.
 
bool operator< (const integer_iterator &other) const
 Compares the value of the iterators.
 
bool operator<= (const integer_iterator &other) const
 Compares the value of the iterators.
 
bool operator== (const integer_iterator &other) const
 Compares the value of the iterators.
 
bool operator> (const integer_iterator &other) const
 Compares the value of the iterators.
 
bool operator>= (const integer_iterator &other) const
 Compares the value of the iterators.
 
reference operator[] (const difference_type &n) const
 Returns an iterator with value equal to the current value plus an integer.
 

Friends

integer_iterator operator+ (const integer_iterator &i, const difference_type &j)
 Adds an integer to the value of the iterator.
 
integer_iterator operator+ (const difference_type &i, const integer_iterator &j)
 Adds an integer to the value of the iterator.
 
integer_iterator operator- (const integer_iterator &i, const difference_type &j)
 Subtracts an integer from the value of the iterator.
 
integer_iterator operator- (const difference_type &i, const integer_iterator &j)
 Subtracts an integer from the value of the iterator.
 
difference_type operator- (const integer_iterator &i, const integer_iterator &j)
 Subtracts the values of the two iterators.
 

Detailed Description

template<class T, class Tag = void>
struct cal::integer_iterator< T, Tag >

An RandomAccessIterator that stores an integer value of type T. The dereferenced value of the iterator is the integer itself.

Template Parameters
TAn integer type to be wrapped.
TagAn arbitrary tag used to distinguish between specializations of this template.