Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2003-06-11 18:18:23


On Wednesday, June 11, 2003, at 05:55 PM, Dave Gomboc wrote:

> Why is
> a deque inadequate?

deque is more expensive than a resizing circular buffer in both
performance and code size. One also can not control *when* deque will
allocate as one can with a resizing circular buffer. In a nutshell, a
resizing circular buffer is often a better deque than std::deque is.
;-( A resizing circular buffer is absolutely awesome when plugged into
std::queue. If your queue on average doesn't constantly grow, a
resizing circular buffer is efficient, predictable and safe. A
std::deque in std::queue will likely continually rellocate buffers as
it drops one off one end and adds one to the other (and at annoyingly
unpredictable times if you're doing real-time).

-Howard


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