I think I understand how iterators will compile in the simple case using
in. However I’m unsure about how to think about iterators that get passed around functions, which then add their own iterators. Will this all compile down to a simple loop at the point where it’s consumed? By “simple” I mean equivalent to manually writing out the loop instead of using iterators.
Are there any inefficiencies or gotchas I should be aware of?