Iterators for sets and vectors.

The code still uses loops over the 0..size-1, though.