index_iterator Class Template Reference

#include <stlsoft/iterators/index_iterator.hpp>

List of all members.


Detailed Description

template<typename I, typename T = adapted_iterator_traits<I>>
class stlsoft::index_iterator< I, T >

An indexed iterator class.

The implementation of this class template is described in a bonus chapter on the CD for Extended STL, volume 1

Public Types

Member Types
typedef I base_iterator_type
typedef T traits_type
typedef index_iterator< I > class_type
typedef
traits_type::iterator_category 
iterator_category
typedef traits_type::value_type value_type
typedef traits_type::pointer pointer
typedef traits_type::reference reference
typedef
traits_type::difference_type 
difference_type
typedef traits_type::const_pointer const_pointer
typedef
traits_type::const_reference 
const_reference
typedef
traits_type::effective_reference 
effective_reference
typedef
traits_type::effective_const_reference 
effective_const_reference
typedef ss_ptrdiff_t index_type
typedef
traits_type::effective_pointer 
effective_pointer
typedef
traits_type::effective_const_pointer 
effective_const_pointer

Public Member Functions

Construction
 index_iterator ()
 index_iterator (base_iterator_type it, index_type index=0)
 index_iterator (class_type const &rhs)
base_iterator_type base () const
 A copy of the base iterator.
Forward Iterator methods
class_typeoperator++ ()
class_type operator++ (int)
effective_reference operator* ()
effective_const_reference operator* () const
effective_pointer operator-> ()
effective_const_pointer operator-> () const
Bidirectional Iterator methods
class_typeoperator-- ()
class_type operator-- (int)
Random-Access Iterator methods
class_typeoperator+= (difference_type n)
 Moves the iterator forward.
class_typeoperator-= (difference_type n)
 Moves the iterator backward.
effective_reference operator[] (difference_type index)
 Access the element at the given index.
effective_const_reference operator[] (difference_type index) const
 Access the element at the given index.
difference_type distance (class_type const &rhs) const
 Calculate the distance between this and rhs.
Index Iterator methods
index_type index () const
Comparison
bool equal (class_type const &rhs) const
int compare (class_type const &rhs) const


Member Function Documentation

base_iterator_type base (  )  const [inline]

A copy of the base iterator.

class_type& operator+= ( difference_type  n  )  [inline]

Moves the iterator forward.

Parameters:
n The amount by which to increment the iterator's current position

class_type& operator-= ( difference_type  n  )  [inline]

Moves the iterator backward.

Parameters:
n The amount by which to decrement the iterator's current position

effective_reference operator[] ( difference_type  index  )  [inline]

Access the element at the given index.

Parameters:
index The required offset from the iterator's position

effective_const_reference operator[] ( difference_type  index  )  const [inline]

Access the element at the given index.

Parameters:
index The required offset from the iterator's position

difference_type distance ( class_type const &  rhs  )  const [inline]

Calculate the distance between this and rhs.

References index_iterator::m_it.


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

Generated on Thu Jun 10 08:58:47 2010 for STLSoft by  doxygen 1.5.6