#include <basearray.h>
Public Types | |
typedef ConstIf< CONSTITERATOR, BaseArray >::Type | CollectionType |
typedef ConstIf< CONSTITERATOR, T >::Type | ValueType |
Static Public Attributes | |
static const Bool | isLinearIterator |
Private Attributes | |
ValueType * | _data |
The BaseArray iterator internally is a pointer and using it to iterate over an array or parts of it is as efficient as using a real pointer (for more ease of use you may want to invoke this via AutoIterator).
As already said you can use an Iterator almost like a pointer, e.g.
Please note that using a postfix operator access (*it++ or *it–) can be slower than using the prefix form or a separate assignment. E.g.
is most likely slower than
or
because *it++ requires a temporary copy of the iterator that the compiler may not be able to remove during optimization. As long as you only use the iterator's postfix operator without assignment it should be fine because the compiler will remove the temporary copy.
typedef ConstIf<CONSTITERATOR, BaseArray>::Type CollectionType |
typedef ConstIf<CONSTITERATOR, T>::Type ValueType |
|
explicit |
|
explicit |
IteratorTemplate | ( | const IteratorTemplate< CONSTITERATOR > & | src | ) |
IteratorTemplate& operator= | ( | const IteratorTemplate< CONSTITERATOR > & | src | ) |
operator ConstIterator & | ( | ) |
Bool IsValid | ( | ) | const |
ValueType* GetPtr | ( | ) | const |
ValueType& operator* | ( | ) | const |
ValueType* operator-> | ( | ) | const |
Bool operator== | ( | const IteratorTemplate< CONSTITERATOR > & | b | ) | const |
Bool operator!= | ( | const IteratorTemplate< CONSTITERATOR > & | b | ) | const |
Bool operator>= | ( | const IteratorTemplate< CONSTITERATOR > & | b | ) | const |
Bool operator<= | ( | const IteratorTemplate< CONSTITERATOR > & | b | ) | const |
Bool operator< | ( | const IteratorTemplate< CONSTITERATOR > & | b | ) | const |
Bool operator> | ( | const IteratorTemplate< CONSTITERATOR > & | b | ) | const |
IteratorTemplate& operator++ | ( | ) |
const IteratorTemplate operator++ | ( | int | ) |
IteratorTemplate& operator+= | ( | Int | i | ) |
IteratorTemplate& operator-- | ( | ) |
const IteratorTemplate operator-- | ( | int | ) |
IteratorTemplate& operator-= | ( | Int | i | ) |
IteratorTemplate operator+ | ( | Int | i | ) | const |
IteratorTemplate operator- | ( | Int | i | ) | const |
Int operator- | ( | const IteratorTemplate< CONSTITERATOR > & | b | ) | const |
|
static |
|
private |