A transform iterator. More...
#include <TransformIterator.h>
Public Types | |
typedef Base::Iterator | Iterator |
The un-transformed iterator type. | |
typedef _Transform | Transform |
The unary function that transforms the iterator. | |
typedef Base::iterator_category | iterator_category |
The iterator category. | |
typedef Base::value_type | value_type |
The type "pointed to" by the iterator. | |
typedef Base::difference_type | difference_type |
Distance between iterators is represented as this type. | |
typedef Base::pointer | pointer |
This type represents a pointer-to-value_type. It is not defined for this iterator. | |
typedef Base::reference | reference |
This type represents a reference-to-value_type. It is not defined for this iterator. | |
Public Member Functions | |
Constructors etc. | |
TransformIterator () | |
Default constructor. | |
TransformIterator (const TransformIterator &x) | |
Copy constructor. | |
TransformIterator & | operator= (const TransformIterator &x) |
Assignment operator. | |
TransformIterator (const Iterator &i) | |
Construct from an iterator. | |
TransformIterator (const Transform &t) | |
Construct from a transform. | |
TransformIterator (const Iterator &i, const Transform &t) | |
Construct from an iterator and a transform. | |
TransformIterator & | operator= (const Iterator &i) |
Assignment from an iterator. | |
Accessors. | |
const Iterator & | base () const |
Return the base iterator. | |
const Transform & | transform () const |
Return the transform functor. | |
Functionality | |
value_type | operator* () const |
Dereference. | |
TransformIterator & | operator++ () |
Pre-increment. | |
TransformIterator | operator++ (int) |
Post-increment. Warning: This is not as efficient as the pre-increment. | |
TransformIterator & | operator-- () |
Pre-decrement. | |
TransformIterator | operator-- (int) |
Post-decrement. Warning: This is not as efficient as the pre-decrement. | |
value_type | operator[] (const difference_type &n) const |
Sub-scripting. | |
TransformIterator & | operator+= (const difference_type &n) |
Addition assignment. | |
TransformIterator | operator+ (const difference_type &n) const |
Addition. | |
TransformIterator & | operator-= (const difference_type &n) |
Subtraction assignment. | |
TransformIterator | operator- (const difference_type &n) const |
Subtraction. | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename _Iterator , class _Transform > | |
TransformIterator< _Iterator, _Transform > | operator+ (typename TransformIterator< _Iterator, _Transform >::difference_type n, const TransformIterator< _Iterator, _Transform > &x) |
Offset from an iterator. | |
template<typename _Iterator , class _Transform > | |
TransformIterator< _Iterator, _Transform > | constructTransformIterator () |
Convenience function for instantiating a TransformIterator. | |
template<typename _Iterator , class _Transform > | |
TransformIterator< _Iterator, _Transform > | constructTransformIterator (const typename TransformIterator< _Iterator, _Transform >::Iterator &i) |
Convenience function for instantiating a TransformIterator. | |
template<typename _Iterator , class _Transform > | |
TransformIterator< _Iterator, _Transform > | constructTransformIterator (const typename TransformIterator< _Iterator, _Transform >::Transform &t) |
Convenience function for instantiating a TransformIterator. | |
template<typename _Iterator , class _Transform > | |
TransformIterator< _Iterator, _Transform > | constructTransformIterator (const typename TransformIterator< _Iterator, _Transform >::Iterator &i, const typename TransformIterator< _Iterator, _Transform >::Transform &t) |
Convenience function for instantiating a TransformIterator. | |
template<typename IntIter , typename DataIter > | |
TransformIterator< IntIter, IndexIterUnary< DataIter > > | constructArrayIndexingIterator (IntIter i, DataIter d) |
Convenience function for instantiating a TransformIterator that indexes an array. |
A transform iterator.
The dereferencing member function, operator*(), dereferences and then applies the transformation.
TransformIterator< IntIter, IndexIterUnary< DataIter > > constructArrayIndexingIterator | ( | IntIter | i, | |
DataIter | d | |||
) | [related] |
Convenience function for instantiating a TransformIterator that indexes an array.
This changes an iterator on integers to an iterator over the values in an array.