Lifetime question regarding iterators

This is the same issue as described and explained in this thread.