They simply want to use the objects and forget about them prior to getting the next object from the iterator.
I see no need to return pointers (smart pointers, or what have you) to objects allocated in the heap.