My understanding of STL and its iterators is incompatible with your proposal. Iterators in the C ++ standard library (as is now known) have pointer semantics. They do not wrap, and end() not equal to begin() .
As analog pointers, iterators indicate a location in the buffer. You cannot expect a linear copy operation by a naive caller to be completed at the end. This will be applied through the algorithm and other libraries. As far as I know, they simply will not work as expected.
I don’t see any reason why you should not use STL collections and iterators, but I don’t think you should expect (or force) it++ wrap it. I rather believe that you need clearly visible member functions that implement the required additional functions.
For example, you might have an incr() function that increments an iterator, but if it points to end() , it wraps itself in the beginning. You may have a copy() function that understands how to retrieve or insert a block of data into a buffer that wraps.
But then I don’t understand your other limitations, so this may not work for you. I think this will work for me.
source share