I'm writing a C++ wrapper for a 3rd party C library.
The library provides some functions for iterating through a series of objects.
I want to write an iterator to wrap this behaviour so iteration is easier, but I cannot think how I will be able to provide the mandatory 'difference' type since the iterated objects don't have a meaningful relative order and the API I am working with does not provide a means of finding the number of objects available in advance.
I can't count the objects as they're iterated because although that would solve individual iterators it would render the difference between the end()
iterator and other iterators undefined.