Boost logo

Boost Users :

Subject: Re: [Boost-users] circular buffer in a multithreaded program
From: Sebastian Gesemann (s.gesemann_at_[hidden])
Date: 2014-04-24 03:51:42

On Thu, Apr 24, 2014 at 8:44 AM, Antony Polukhin <antoshkka_at_[hidden]> wrote:
> You are right. Iterator holds a pointer to circular_buffer and accesses some
> of its internals.
> However it is safe to use only iterators and overwrite independent parts of
> circular_buffer. All the operations with iterators do not modify internals
> of circular_bufer.
> So if you change cb.erase_first(n)/cb.resize(cb.capacity()) to iterator
> operations there must be no problems. Though I thinks that's what you have
> done in case of custom vector-based data structure.

And what iterator operations would that be? Before erase_first, I
tried the iterator-based erase, but it actually had iterator
invalidation properties that were of no use to me IIRC.

> Thanks for the investigation!

Thanks for taking the time to read what I had to say. :)


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at