
Cached location is meant to be used as a quick way to get to neighborhood pixels if you need to read or write a neighboring location frequently relative to a given locator. But the only reason you would prefer an iterator instead is if you want to move it. I cannot think of a case where you want to construct millions of iterators at fixed locations relative to a current locator... Can you explain why you would need such functionality? I write a flood fill algorithm, so I often need to visit the 8 neighbors and next visit the new neighbors... So I like the idea of moving my locator with 8 cached_location. For this kind of algorithm, we often need to move with the same steps, so I think it's interesting to use cached_location. I don't think it's a so particular case.
PS: If you want to see my actual use as a concrete example. https://github.com/tuttleofx/TuttleOFX/blob/master/plugins/image/process/fil...