|
Boost : |
From: Jan Gaspar (jga_at_[hidden])
Date: 2003-04-22 02:43:37
"Paul A. Bristow" wrote:
> Thanks for this. It seems to work OK with MSVC 7.0.
>
> But I am confused at the relationship, if any, with the cyclic_iterator
> proposal.
>
The cyclic iterator has not much common with cyclic buffer. Cyclic buffer is a
container with restricted capacity. If it is full the newly added (pushed back)
element replaces the first (oldest) element. The iterator of the cyclic buffer was
mainly designed for iterating from begin to end of the buffer (this iterator
should not be considered as cyclic).
On the other hand the cyclic iterator is designed to iterate over any kind of
container (not only over cyclic buffer). When it reaches the end it moves to the
beginnig of the container.
>
> Paul
>
> Paul A Bristow, Prizet Farmhouse, Kendal, Cumbria, LA8 8AB UK
> +44 1539 561830 Mobile +44 7714 33 02 04
> Mobile mailto:pabristow_at_[hidden]
> mailto:pbristow_at_[hidden]
>
> | -----Original Message-----
> | From: boost-bounces_at_[hidden]
> | [mailto:boost-bounces_at_[hidden]]On Behalf Of Jan Gaspar
> | Sent: Thursday, April 10, 2003 4:07 PM
> | To: Boost mailing list
> | Subject: Re: [boost] Statistics code example -
> | usingcycliciterator/buffer/array
> |
> |
> | Hi all!
> |
> | I have refactored my implelentation of the cyclic buffer. Its
> | underlaying container is now vector
> | (previosly it was deque). There is still one problem - iterator
> | invalidation. If you add or remove an
> | element from the end of the buffer, the iterators becomes invalidated.
> |
> | Jan
> |
> | --
> | Jan Gaspar | jga_at_[hidden]
> | Whitestein Technologies | www.whitestein.com
> | Panenska 28 | SK-81103 Bratislava | Slovak Republic
> | Tel +421(2)5930-0721 | Fax +421(2)5443-5512
> |
> |
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- Jan Gaspar | jga_at_[hidden] Whitestein Technologies | www.whitestein.com Panenska 28 | SK-81103 Bratislava | Slovak Republic Tel +421(2)5930-0721 | Fax +421(2)5443-5512
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk