Support 'foreach' method in data structures.