Re:Writing a custom iterator in modern C++
by pumpkinpal on Monday December 21, 2020 @04:45AM
(#25493438)
The iterator and sentinel do not need to be the same type, they just need to be equality comparable. If you wanted to represent a infinite range you could implement it in terms of a regular iterator and an empty sentinel type to which the regular iterator compares false to.
[ Parent
| on HN ]