"Alisdair Meredith" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > Bo Persson wrote: > > > Instead of dropping elements when the buffer is full, we might also > > consider waiting or throwing a failure. > > "The one true circular buffer template" is a nigh impossible goal, > because it means so many things to different people. >
Yes, sure. I just reacted to the suggested names cyclic_buffer and circular_buffer, which means slightly different things to me. In one case we have a cycle, like in your case with a few minutes of samples. The latest n samples are interesting, the older ones can be discarded. Another use for a circular (not cyclic :-) buffer is for the producer-consumer case, where some objects are queued temporarily. Here we can have the buffer wrap around at the ends, so we don't have to move any objects after a pop_front(). We can redefine the front position instead. If you run in a circle, you don't have an end case. Bo Persson [EMAIL PROTECTED] _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost