25 template <
class Cont,
class T>
27 :
public std::iterator<std::random_access_iterator_tag,T,size_t> {
52 if ( c.IsSet() && (pos < c->size()) ) {
71 inline const T&
operator* ()
const {
return (*c)[pos]; }
73 inline const T*
operator-> ()
const {
return &(*c)[pos]; }
78 inline const T&
operator[] (
size_t x)
const {
return (*c)[pos+x]; }
143 template <
class Cont,
class T>
Provides a set of convenience macros for metaprogramming and debugging.
#define RC_DEFAULT_COMPARISON()
Given == and <, generates !=, >, <=, and >=.
Definition: Macros.h:246
A reference counting pointer that revokes (NULLs) all copies when one set to AutoRevoke(true) leaves ...
Provides typedefs and routines for working with primitives.
A bounds-checked iterator for random-access containers that knows when its target was deleted.
Definition: Iter.h:27
RAIter< Cont, T > operator-(size_t x) const
Returns a new iterator with an offset decremented by x.
Definition: Iter.h:111
RAIter()
Default constructor to nothing, by default invalid for use.
Definition: Iter.h:31
RAIter< Cont, T > operator+(size_t x) const
Returns a new iterator with an offset incremented by x.
Definition: Iter.h:104
RAIter< Cont, T > & operator-=(size_t x)
Decrease the index by x.
Definition: Iter.h:87
RevPtr< Cont > Raw()
Directly access the RevPtr to the container.
Definition: Iter.h:64
bool operator==(const RAIter< Cont, T > &other) const
True if the two iterators have the same index.
Definition: Iter.h:124
const T * operator->() const
Provides access to members of the element this iterator points to.
Definition: Iter.h:73
RAIter< Cont, T > & operator+=(size_t x)
Increase the index by x.
Definition: Iter.h:85
RAIter< Cont, T > & operator--()
Point to the next lower numbered indexed element.
Definition: Iter.h:83
bool IsValid() const
True if the iterator still points to an existing container and remains in bounds.
Definition: Iter.h:51
bool operator<(const RAIter< Cont, T > &other) const
True if this iterator is less.
Definition: Iter.h:129
RAIter(RevPtr< Cont > container, size_t pos)
Creates an iterator to a container starting at index pos.
Definition: Iter.h:43
RAIter< Cont, T > & operator++()
Point to the next higher numbered indexed element.
Definition: Iter.h:81
T & operator*()
Dereference the iterator, returning a reference to the corresponding element.
Definition: Iter.h:69
T & operator[](size_t x)
Provides access to the element at offset x from the current index.
Definition: Iter.h:76
size_t GetIndex() const
Return the index of the container which this iterator corresponds to.
Definition: Iter.h:62
RAIter< Cont, T > operator+(size_t x, const RAIter< Cont, T > &iter)
Returns a new iterator with an offset incremented by x.
Definition: Iter.h:144