19 Feb
2009
19 Feb
'09
2:44 a.m.
On Wed, Feb 18, 2009 at 5:16 PM, Scott McMurray
Perhaps this?
boost::circular_buffer
schedule(100); Then you could use
schedule.rotate(schedule.begin()+1);
to move to the next bucket, which should (in steady-state) avoid reallocation of the container or the buckets, since you never actually destruct or copy the vectors.
http://www.boost.org/doc/libs/1_38_0/libs/circular_buffer/doc/circular_buffe...
Wow, this is actually perfect. So before I do a rotate(), I need to do: schedule[0].clear() right? When I do future push_back operations on schedule[99], I want it to be adding to an empty vector and not adding to the old contents of it. I appreciate your help!