foreach macro <BLOC/iterator.h>

The foreach macro uses the iterator_* functions to traverse an iterable object. It traverses from the start to the end, and has a similar syntax to a normal for loop. It is not possible to use an initial declaration in the macro, the item variable must be declared before hand. It is safe to nest this macro, provided you do not attempt to pass the same item variable in.

Syntax

#define foreach(i,e) for (...)

Parameters

i

A pointer to an iterable object. An iterable object is any object that has an iterable header

e

The variable that all entries should be assigned to. This must be previously declared.