The random access iterator for the RWGenMat collection class.
More...
#include <rw/math/genmat.h>
template<class T>
class RWGenMatIterator< T >
Class RWGenMatIterator is the random access iterator for the RWGenMat collection class. The RWGenMatIterator class behaves like a pointer to type T
, and is used to increment through elements of an RWGenMat.
- Note
- This class should be accessed as the typedef RWGenMat::iterator.
- Example
#include <rw/math/genmat.h>
int main()
{
for (int j=0; i != stop; ++i, ++j) *i = j;
}
Constructs an iterator that is in an uninitialized state. The iterator must be initialized before it is dereferenced.
Returns a reference to the element pointed to by self.
Prefix increment operator. The iterator points to the next element in the RWGenMat. No error condition is set if the iterator goes past the bounds of the matrix. Compare to RWGenMat::begin() and RWGenMat::end() to check that the iterator position is valid.
Postfix increment operator. The iterator points to the next element in the RWGenMat. No error condition is set if the iterator goes past the bounds of the matrix. Compare to RWGenMat::begin() and RWGenMat::end() to check that the iterator position is valid.
The RWGenMatIterator is moved forward d elements in the RWGenMat. No error condition is set if the iterator goes past the bounds of the matrix. Incrementing by d and then decrementing by d returns the iterator to its original position, even if doing so takes it past the bounds of the matrix.
Prefix decrement operator. The iterator points to the previous element in the RWGenMat. No error condition is set if the iterator goes past the bounds of the matrix. Compare to RWGenMat::begin() and RWGenMat::end() to check that the iterator position is valid.
Postfix decrement operator. The iterator points to the previous element in the RWGenMat. No error condition is set if the iterator goes past the bounds of the matrix. Compare to RWGenMat::begin() and RWGenMat::end() to check that the iterator position is valid.
The RWGenMatIterator is moved backward d elements in the RWGenMat. No error condition is set if the iterator goes past the bounds of the matrix. Incrementing by d and then decrementing by d returns the iterator to its original position, even if doing so takes it past the bounds of the matrix.
For iterator a, and identifier m, a->m is equivalent to (*a).m.
Returns a reference to the element n elements after self if n is positive, or n elements before n if n is negative.