I am looking for a simple way to iterate through a set of integers in C++. For example, if I had an integer variable 'x' and wanted to use the increment statement 'x++' continuously over 4 integer values, the desired output would be something like '0 1 2 3 0 1 2...'.
I know that a circularly linked list is a solution, but it just seems like overkill to me, I really need something short and sweet. I suspect that enumerated types may be able to do something like this, but my research has not turned up anything.