Boost logo

Boost :

From: Synge Todo (wistaria_at_[hidden])
Date: 2002-02-08 08:31:17


From: "Peter Dimov" <pdimov_at_[hidden]>
Date: Fri, 8 Feb 2002 14:57:12 +0200
> From: "John Maddock" <John_Maddock_at_[hidden]>
> > >If there is no implementation problem in the current code, I will
> > >start to rewrite fixed_capacity_deque too.
> >
> > Am I missing something or is a fixed capacity deque some kind of oxymoron?
> > The issue is that the only difference between a vector and a deque is in
> > the way that memory management is conducted, so if there isn't any memory
> > management then what's the point? A fixed cyclic buffer however would be
> a
> > good idea. Or have I got this backwards?
>
> Well, a fixed cyclic buffer is a fixed deque, as I understand it. A vector
> has push/pop_back, a deque has push/pop_back/front.

Exactly.

> A fixed deque with 2^n capacity is almost never worse than a fixed vector.

Indeed, the difference between them is very tiny, but in fixed_capacity_deque,

1) one more pointer is required as its member,
2) iterator is not a simple pointer
3) access to an element by index and increment/decrement operation for
   iterators needs one more `mod' operation.

Synge Todo
wistaria_at_[hidden]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk