#include <Indices.hpp>
The Indices class can be used to iterate over zero-based indices of type int in forward or backward order based on a run-time flag. For example:
for (
int index :
Indices(4,
true)) { }
Definition: Indices.hpp:31
It is also possible to specify any container that implements size():
vector xv(4);
for (
int index :
Indices(xv,
true)) { }
◆ Indices() [1/2]
Indices::Indices |
( |
int |
range, |
|
|
bool |
reverse = false |
|
) |
| |
|
inline |
This constructor intializes an index range with the specified number of zero-based indices. The second argument indicates iteration direction: false (or missing) for forward iteration; true for backward iteration.
◆ Indices() [2/2]
template<class C >
Indices::Indices |
( |
C |
cont, |
|
|
bool |
reverse = false |
|
) |
| |
|
inline |
This constructor intializes an index range with a number of zero-based indices corresponding to the size of the specified container. The container class must implement the size() function. The second argument indicates iteration direction: false (or missing) for forward iteration; true for backward iteration.
◆ begin()
This function returns the begin iterator corresponding to the iteration direction.
◆ end()
This function returns the end iterator corresponding to the iteration direction.
The documentation for this class was generated from the following file: