
On Thu, Apr 24, 2014 at 8:44 AM, Antony Polukhin
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. :) Cheers! Sebastian