------------------------------ Date: Thu, 12 Jun 2003 02:36:10 +1000 From: Nigel Stewart <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: [boost] Re: Review Request: cyclic_buffer Message-ID: <[EMAIL PROTECTED]> In-Reply-To: <[EMAIL PROTECTED]> References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> Content-Type: text/plain; charset=us-ascii; format=flowed MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: list Message: 15
> 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) > time) 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 implications. 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. Dave _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost