28 typedef ptrdiff_t difference_type;
31 typedef std::input_iterator_tag iterator_category;
110 return (m_iter-that.m_iter);
133 TrIterator<T> operator+(
int n,
const TrIterator<T>& iter)
135 return iter.operator+(n);
144 TrIterator<T> operator-(
int n,
const TrIterator<T>& iter)
146 return iter.operator-(n);
190 : m_begin(b), m_end(e) {}
204 if (m_begin>m_end)
invert();
214 m_begin = that.m_begin;
233 m_begin.operator++();
261 m_begin.operator--();
290 TrRange tmp(m_begin.operator+(n),
303 TrRange tmp(m_begin.operator-(n),
316 m_begin.operator+=(n);
329 m_begin.operator-=(n);
339 typename TrIterator<T>::difference_type
range()
const {
return (m_end - m_begin);}
355 bool operator==(
const TrRange& that)
const {
return ((m_begin==that.m_begin)&&(m_end==that.m_end));}
368 bool operator<(
const TrRange& that)
const {
return ((m_begin<that.m_begin) && (m_end<that.m_end));}
376 bool operator>(
const TrRange& that)
const {
return ((m_begin>that.m_begin) && (m_end>that.m_end));}
401 TrRange<T> operator+(
int n,
const TrRange<T>& range)
403 TrRange<T> tmp = range.operator+(n);
421 TrRange<T> operator-(
int n,
const TrRange<T>& range)
423 TrRange<T> tmp = range.operator-(n);
TrIterator operator--(int)
iter– type decremenation
Definition: TrIterator.hpp:91
bool operator<=(const TrIterator &iter) const
Less than or equal to operator.
Definition: TrIterator.hpp:75
bool operator==(const TrRange &that) const
Equality operator.
Definition: TrIterator.hpp:355
TrIterator template class.
Definition: TrIterator.hpp:24
TrIterator< T > end() const
Get value of end iterator.
Definition: TrIterator.hpp:224
TrRange & operator-=(int n)
range -=n style decrement
Definition: TrIterator.hpp:327
TrRange(const TrRange &that)
Copy constructor.
Definition: TrIterator.hpp:208
bool operator>(const TrRange &that) const
Greater than operator.
Definition: TrIterator.hpp:376
TrRange class.
Definition: TrIterator.hpp:173
TrRange & operator--()
–range style decrementation
Definition: TrIterator.hpp:259
void invert()
Swap begin and end iterators.
Definition: TrIterator.hpp:342
TrIterator operator+(int n) const
iter+n
Definition: TrIterator.hpp:95
TrRange operator-(int n) const
range-n style decrement
Definition: TrIterator.hpp:301
TrRange & operator++()
++range style incrementation
Definition: TrIterator.hpp:231
TrRange(const TrIterator< T > &ref, int range)
Range specified constructor.
Definition: TrIterator.hpp:202
TrRange(const TrIterator< T > &b=TrIterator< T >(), const TrIterator< T > &e=TrIterator< T >())
Default constructor.
Definition: TrIterator.hpp:188
bool operator!=(const TrIterator &iter) const
Inequality operator.
Definition: TrIterator.hpp:70
TrIterator(const T *iter=0)
Default constructor.
Definition: TrIterator.hpp:44
TrIterator & operator+=(int n)
iter += n
Definition: TrIterator.hpp:97
TrRange & operator+=(int n)
range += n support
Definition: TrIterator.hpp:314
TrIterator< T >::difference_type range() const
Compute distance between begin and end.
Definition: TrIterator.hpp:339
difference_type operator-(const TrIterator &that) const
Distance between two iterators.
Definition: TrIterator.hpp:108
TrIterator operator-(int n) const
iter-n
Definition: TrIterator.hpp:99
TrIterator & operator++()
++iter type incrementation
Definition: TrIterator.hpp:83
TrIterator(const TrIterator &iter)
Copy constructor.
Definition: TrIterator.hpp:51
TrIterator< T > begin() const
Get value of begin iterator.
Definition: TrIterator.hpp:222
Definition: AlgoIterator.hpp:12
TrRange operator+(int n) const
range+n style increment
Definition: TrIterator.hpp:288
value_type operator*() const
Dereference operator.
Definition: TrIterator.hpp:118
TrRange & operator=(const TrRange &that)
Assignment operator.
Definition: TrIterator.hpp:211
TrIterator & operator-=(int n)
iter -= n
Definition: TrIterator.hpp:101
TrIterator & operator=(const TrIterator &iter)
Assignment operator.
Definition: TrIterator.hpp:59
bool operator<(const TrRange &that) const
Less than operator.
Definition: TrIterator.hpp:368
TrRange operator++(int)
range++ style incrementation
Definition: TrIterator.hpp:245
TrIterator & operator--()
–iter type decrementation
Definition: TrIterator.hpp:89
bool operator!=(const TrRange &that) const
Inequality operator.
Definition: TrIterator.hpp:357
bool operator<(const TrIterator &iter) const
Less than operator.
Definition: TrIterator.hpp:73
TrRange operator--(int)
Decrementation range–;.
Definition: TrIterator.hpp:273
bool operator>=(const TrIterator &iter) const
Greater than or equal to operator.
Definition: TrIterator.hpp:79
bool operator==(const TrIterator &iter) const
Equality operator.
Definition: TrIterator.hpp:68
bool operator<=(const TrRange &that) const
Greater than or equal operator.
Definition: TrIterator.hpp:379
TrIterator operator++(int)
iter++ type incremenation
Definition: TrIterator.hpp:85
bool operator>=(const TrRange &that) const
Less than or equal operator.
Definition: TrIterator.hpp:381
bool operator>(const TrIterator &iter) const
Greater than operator.
Definition: TrIterator.hpp:77