Public domain code.
#define for_each(type, it, L) for (type::iterator (it) = (L).begin(); (it) != (L).end(); ++(it))
for_each(T, it, L) { printf("%d\n", (*it));}