It would be nice to have an iterator interface on the RingBuffer, then you can use the STL algorithms on the RingBuffer.
All required for that is a begin and end method returning the iterators.
You could then, for instance, sum up the values in the BufferEasily using std::accumulate.
It would be nice to have an iterator interface on the RingBuffer, then you can use the STL algorithms on the RingBuffer. All required for that is a
begin
andend
method returning the iterators. You could then, for instance, sum up the values in the BufferEasily usingstd::accumulate
.