Circular Iterator Adapter
Wrap a fixed array in an iterator that wraps around at the end, so a round-robin scheduler can walk it forever without an explicit modulo at every call site.
Constraints
- Must satisfy the forward iterator requirements for reading.
- ++ at the last element must return to the first.
- Provide a way to detect a full lap so callers can terminate.
- No allocation.
- Must work with a C array and with std::array.
1#include <cstddef>2 3template <typename T>4class CircularIterator {5 // TODO6};