Hacker News new | ask | show | jobs
by gregwebs 380 days ago
Not all impure iterators can be resumed. But any pure iterator can be converted to a resumable iterator with a generic conversion function.
1 comments

> any pure iterator can be converted to a resumable iterator with a generic conversion function.

Makes sense

> Not all impure iterators can be resumed

How do you mean? In my head resuming an iterator is just partially unrolling a loop.

An impure iterator can panic, so you can't resume?