From 4132394345158124505
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,9384bfc667402a91
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2004-03-16 18:53:17 PST
Path: archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed.stueberl.de!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: kuyper@wizard.net (James Kuyper)
Newsgroups: comp.std.c++
Subject: Re: Vector should be used by default?
Date: Wed, 17 Mar 2004 02:53:15 +0000 (UTC)
Organization: http://groups.google.com
Lines: 32
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <8b42afac.0403161150.4a813b0a@posting.google.com>
References: <c2lq2i$m3m$1@news.kreonet.re.kr> <2bbfa355.0403101207.36b3fe02@posting.google.com> <c2oaqh$i5$1@news.kreonet.re.kr>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: mail2news.demon.co.uk 1079491996 14439 10.0.0.1 (17 Mar 2004 02:53:16 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Wed, 17 Mar 2004 02:53:16 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.12)
	id 1B3RBC-0003kk-00
	for mail2news@news.news.demon.net; Wed, 17 Mar 2004 02:53:15 +0000
X-Received: from mulga.cs.mu.OZ.AU (localhost [127.0.0.1]) by mulga.cs.mu.OZ.AU with ESMTP
	id i2H2rAi2027049; Wed, 17 Mar 2004 13:53:10 +1100 (EST)
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id i2H2rA4T027040;
	Wed, 17 Mar 2004 13:53:10 +1100 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ucar.edu
X-Newsgroups: comp.std.c++
X-NNTP-Posting-Date: Tue, 16 Mar 2004 19:50:29 +0000 (UTC)
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.60-mulga_r1 (1.212-2003-09-23-exp) on 
	mulga.cs.mu.OZ.AU
X-Spam-Status: No, hits=0.1 required=5.2 tests=AWL autolearn=no 
	version=2.60-mulga_r1
Xref: archiver1.google.com comp.std.c++:1356

stkim@yujinrobot.com ("Kim, Seungtai") wrote in message news:<c2oaqh$i5$1@news.kreonet.re.kr>...
> "Bill Wade" <wade@stoner.com> wrote in message news:2bbfa355.0403101207.36b3fe02@posting.google.com...
..
> > For the operations that vector (and vector iterator)
> > can perform in amortized constant time, the cost (CPU time, and memory
> > space) is often better, by a large magnitude, than the same operations
> > with deque or list.  In almost no case is a set of O(1) vector
> > operations more than three times as expensive (with current
> > implementations) than the cheaper of deque or list.
> 
> Not all the times as bellow explained by you.

I'm not sure what that means.

> But the Standard says "should be used by default". What is the criterion on it?

"By default" means simply that you should use the following criteria:
if you know enough about how your program will work, that you can
confidently predict that one of the other containers would be best,
then you should use that container. If you don't know enough about the
situation to make a decision, or if there's no clear advantage to any
of those containers relative to use_vector, then you should use
vector. It might not be the best solution, but it's not going to be
enormously worser than the best solution. That's not true with the
other standard containers.

---
[ 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://www.jamesd.demon.co.uk/csc/faq.html                       ]



