Custom iterator for generators to allow for range-based for loops. More...
#include <generator.hpp>
Public Member Functions | |
generatorIter (std::function< const yield< T >(S &)> lambda, const S &state, bool dummy=false) | |
Constructor. | |
const T & | operator* () const |
Get the current value from the generator. | |
generatorIter & | operator++ () |
Generate the next value. | |
bool | operator!= (const generatorIter &other) const |
Check if the generator can get more data. | |
Custom iterator for generators to allow for range-based for loops.
|
inlineexplicit |
Constructor.
lambda | The generator function. |
state | The state data that may be mutated by the generator function. |
dummy | If true, do not generate data. This is here just so range-based loop syntax will work. |
|
inline |
Check if the generator can get more data.
|
inline |
Get the current value from the generator.
|
inline |
Generate the next value.