Boost logo

Boost Users :

Subject: Re: [Boost-users] circular_buffer, debug and invalid iterator checking
From: Nigel Stewart (nigels.com_at_[hidden])
Date: 2010-11-05 23:26:19


> maximum number, or some condition on the stored data (e.g. the sum must be
> below a threshold) is met.  So I figured I'd store the data in a circular
> buffer, and push new data onto the front, and store my own
> iterator into it to use as the end.

Anthony,

Would it be viable to simply erase the remaining items, rather than
storing the iterator my_end?

>From an efficiency point of view it seems like the sum could be
updated for each push, and then iteration over the items that
need removing (from the end), rather than re-traversing the
items at the front that need to be kept.

Just a thought.

- Nigel


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net