From 2541630303913973349
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,cd1ac2d60a3f06
X-Google-Attributes: gidf78e5,public
From: emarkp@soda.CSUA.Berkeley.EDU (E. Mark Ping)
Subject: Re: What the deque?!
Date: 2000/07/01
Message-ID: <8jik13$98p$1@agate.berkeley.edu>#1/1
X-Deja-AN: 640898044
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
References: <MPG.13c481aa27f926e798970c@news.supernews.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Trace: mail2news.demon.co.uk 962384850 mail2news:20231 mail2news mail2news.demon.co.uk
Organization: Computer Science Undergraduate Association at UC Berkeley
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
NNTP-Posting-Date: 30 Jun 2000 17:05:39 GMT
Newsgroups: comp.std.c++

In article <MPG.13c481aa27f926e798970c@news.supernews.com>,
Scott Meyers <smeyers@aristeia.com> wrote:
>I can describe deque's behavior and technical strengths/weaknesses
>until the ruminants come home, but that's not what I need.  What I
>need are some plausible examples of problems where a deque's
>behavior, strengths, and weaknesses are a better match for the
>problems than are the other standard containers or container
>adapters.

Well, I found it invaluable.  In general it could be used for any
intrusive queue.  In my case, I used deque for a shared queue.  With
many consumers, I maintained indices into the deque so each consumer
could read its own "front" of its queue.  After all consumers had read
past the first x elements of the deque, I could trim off that part.

Amusingly enough, I was about to implement the data structure on my
own until I ran into an in-depth discussion of deque (and thus began
my exciting foray into STL).
-- 
                              |  "If hard data were the filtering criterion
Mark Ping                     |   you could fit the entire contents of the
emarkp@soda.CSUA.Berkeley.EDU |   Internet on a floppy disk."
                              | - Cecil Adams, The Straight Dope Tells All

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




