Writing Custom Iterators3 years ago
What methods are needed for an iteror? | Handling the end of iteration | Breaking out of a loop at end of iteration | Detecting end of iteration with a sentinel value | Unsafe sentinel values | Safe sentinel values | A simple iterator | A stateful iterator that stops | Using an iterator inside an iterator | A recycling iterator | Limiting infinite iterators | Conclusion
