From: Dave Gomboc (dave_at_[hidden])
Date: 2003-06-11 16:55:47
Date: Thu, 12 Jun 2003 02:36:10 +1000
From: Nigel Stewart <nigels_at_[hidden]>
Subject: [boost] Re: Review Request: cyclic_buffer
Content-Type: text/plain; charset=us-ascii; format=flowed
> This strikes me as a good compromise. For one thing, it leaves the
> door open to inserting in a manner that resizes the capacity. (Except
> for the problem that if the buffer is full, every insert will require O(n)
I later realised an important point: insert will be O(n)
anyway, given the need to make room for the inserted items.
So, it seems that allowing automatic resizing in this
case does not cost anything in terms of performence
Every insert will *not* require O(n) time, unless the implementation is,
to quote another poster, "brain-damaged".
Is there a compelling use case for a circular buffer that resizes? Why is
a deque inadequate? IME circular buffers are constant-sized.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk