PLaSK library
|
Template to create iterators for containers which have operator[]. More...
#include <plask/utils/iterators.hpp>
Public Member Functions | |
IndexedIterator () | |
Construct uninitialized iterator. Don't use it before initialization. | |
IndexedIterator (ContainerType *container, std::size_t index) | |
Construct iterator which point to given index in given container. | |
std::size_t | getIndex () const |
Get current iterator position (index). | |
Public Attributes | |
ContainerType * | container |
Pointer to container over which we iterate. | |
std::size_t | index |
Current iterator position (index). | |
Friends | |
class | boost::iterator_core_access |
Template to create iterators for containers which have operator[].
ContainerType | type of container (can be const or non-const) |
Reference | iterator reference type, should be the same type which return container operator[] In most cases it can be auto-deduced from ContainerType, but only if ContainerType is fully defined and known. |
dereference_f | function which perform dereference on container, by default calls operator[] |
Example:
Definition at line 260 of file iterators.hpp.
|
inline |
Construct uninitialized iterator. Don't use it before initialization.
Definition at line 269 of file iterators.hpp.
|
inline |
Construct iterator which point to given index in given container.
container | container to iterate over |
index | index in container |
Definition at line 276 of file iterators.hpp.
|
inline |
Get current iterator position (index).
Definition at line 282 of file iterators.hpp.
|
friend |
Definition at line 285 of file iterators.hpp.
ContainerType* plask::IndexedIterator< ContainerType, Reference, dereference_f >::container |
Pointer to container over which we iterate.
Definition at line 263 of file iterators.hpp.
std::size_t plask::IndexedIterator< ContainerType, Reference, dereference_f >::index |
Current iterator position (index).
Definition at line 266 of file iterators.hpp.