Easiest way to make a cyclic iterator (circulator)?
问题 I have an object that I want to travel in a continuous loop in a game. I have a series of coordinates in a std::vector that I want to use as waypoints. Is there any way to make an std::vector<T>::iterator cyclic (also known as a circulator)? The best I can come up with is to have two iterators and then whenever the first iterator is exhausted assign to it the value of the second (which would not be used to do anything else) but I am not even sure it will work - will the assignment operator