Boost logo

Boost Users :

Subject: Re: [Boost-users] [circular_buffer] About overwriting elements
From: Daniele Barzotti (daniele.barzotti_at_[hidden])
Date: 2010-04-19 08:35:47


Il 19/04/2010 12:55, Jan Gaspar ha scritto:
> Yes, that behaviour is expected.
> When the circular buffer is empty read_pos points to the end.
> After you put some items into it read_pos will point to the begining.
>
> In your case I would recommend you not to rely on iterators as they may get invalidated.
> Instead, in you read operation rely on array_one() and after that
> clear the whole circular buffer.
>
> Jan

Thanks a lot for the explanation and the suggestion!
Daniele.


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