Fibers in Range Implementations

You will learn how fibers are used with range implementations in this lesson.

We'll cover the following

Almost every range needs to store some information to remember its state of iteration. This is necessary for it to know what to do when its popFront() is called next time. Most range examples that we covered earlier store some kind of state to achieve their tasks.

FibonacciSeries example

For example, FibonacciSeries that we have defined earlier was keeping two member variables to calculate the next next number in the series:

Get hands-on with 1200+ tech skills courses.