Boost logo

Boost Users :

Subject: Re: [Boost-users] [circular_buffer] About overwriting elements
From: Daniele Barzotti (daniele.barzotti_at_[hidden])
Date: 2010-04-16 11:26:30


> What actually happens is something like this:
>
> 1 2 3 3 1 2 2 3 1
> [A][B][C] -> push_back(D) -> [D][B][C] -> push_back(E) -> [D][E][C]
>
> The indexes are adjusted, but the physical locations of the elements
> don't change.
>
> In Christ,
> Steven Watanabe

Thanks Steven,

But this is desired?
In this way is difficult to work on indexes eg with operator[].
What I expect is that the value at index 0 is always at position
Buffer[0] unless it will be replaced by another value...

Suppose I have a producer that write to the buffer and some consumer
that reads from it, each of them at different locations, this could be
accomplish only with iterators?

Regards,
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