Lunchbox
1.8.0
|
Counter-based, as opposed to pointer-based, iterator for any container. More...
#include <indexIterator.h>
Public Member Functions | |
IndexIterator (C *container, const size_t i) | |
IndexIterator (const S &from) | |
template<class U , class V , class W > | |
IndexIterator (const IndexIterator< U, V, W > &from) | |
S & | operator= (const IndexIterator &rhs) |
template<class U , class W > | |
S & | operator= (const IndexIterator< S, U, W > &rhs) |
S & | operator++ () |
S & | operator-- () |
S | operator++ (int) |
S | operator-- (int) |
S | operator+ (const size_t &n) const |
S & | operator+= (const size_t &n) |
S | operator- (const size_t &n) const |
S & | operator-= (const size_t &n) |
ssize_t | operator- (const S &n) const |
bool | operator== (const S &rhs) const |
bool | operator!= (const S &rhs) const |
bool | operator< (const S &rhs) const |
bool | operator> (const S &rhs) const |
bool | operator<= (const S &rhs) const |
bool | operator>= (const S &rhs) const |
size_t | getPosition () const |
Protected Attributes | |
C * | container_ |
size_t | i_ |
Friends | |
class | IndexIterator |
Counter-based, as opposed to pointer-based, iterator for any container.
Uses curiously recurring template pattern to return proper type from assignment and other operators. Access methods are to be implemented by a subclass using container_ and i_. Furthermore subclasses need to implement the necessary constructors (see LFVectorIterator for example).
S | CRTP Subclass type |
C | The container type |
T | The element type |
Definition at line 39 of file indexIterator.h.