From 1595821158253177793
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,9384bfc667402a91
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2004-03-16 18:52:42 PST
Path: archiver1.google.com!news2.google.com!fu-berlin.de!news-FFM2.ecrc.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: do-not-spam-benh@bwsint.com (Ben Hutchings)
Newsgroups: comp.std.c++
Subject: Re: Vector should be used by default?
Date: Wed, 17 Mar 2004 02:52:40 +0000 (UTC)
Lines: 67
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <slrnc5edoo.okv.do-not-spam-benh@shadbolt.i.decadentplace.org.uk>
References: <c2lq2i$m3m$1@news.kreonet.re.kr> <slrnc4uf1k.okv.do-not-spam-benh@shadbolt.i.decadentplace.org.uk> <c2urmb$8gj$1@news.kreonet.re.kr> <3tn650l2s8a5gmekrbibasb4q0ernf2lmk@4ax.com> <c30ttc$q8v$1@news.kreonet.re.kr> <8b42afac.0403140836.11d6064d@posting.google.com> <c34gbd$ldq$1@news.kreonet.re.kr> <8b42afac.0403151148.46729faf@posting.google.com>
X-Trace: mail2news.demon.co.uk 1079491960 14420 10.0.0.1 (17 Mar 2004 02:52:40 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Wed, 17 Mar 2004 02:52:40 +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 1B3RAd-0003kR-00
	for mail2news@news.news.demon.net; Wed, 17 Mar 2004 02:52:39 +0000
X-Received: from mulga.cs.mu.OZ.AU (localhost [127.0.0.1]) by mulga.cs.mu.OZ.AU with ESMTP
	id i2H2qai2026933; Wed, 17 Mar 2004 13:52:36 +1100 (EST)
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id i2H2qZaZ026924;
	Wed, 17 Mar 2004 13:52:35 +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-Reply-To: Ben Hutchings <benh@bwsint.com>
X-Orig-NNTP-Posting-Host: cpc2-cmbg1-4-0-cust2.cmbg.cable.ntl.com (213.107.105.2)
X-Orig-X-Trace: news.uni-berlin.de 1079458212 71153628 I 213.107.105.2 ([70929])
X-Orig-Path: decadentplace.org.uk!nobody
X-User-Agent: slrn/0.9.7.4 (Linux)
X-Spamscanner: mailbox3.ucsd.edu  (v1.4 Dec  3 2003 15:07:19, 0.0/5.0 2.63)
X-MailScanner: PASSED (v1.2.8 32560 i2GHUFEt072181 mailbox3.ucsd.edu)
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.0 required=5.2 tests=none autolearn=no 
	version=2.60-mulga_r1
Xref: archiver1.google.com comp.std.c++:1355

James Kuyper wrote:
> stkim@yujinrobot.com ("Kim, Seungtai") wrote in message
> news:<c34gbd$ldq$1@news.kreonet.re.kr>...
>> "James Kuyper"
>> > stkim@yujinrobot.com ("Kim, Seungtai")
>> > > "Gennaro Prota" <gennaro_prota@yahoo.com>
>> > > > stkim@yujinrobot.com ("Kim, Seungtai") wrote:
>> > > >
>> > > > >How can I infer that the statements is just a guide?
>> > > >
>> > > > By ISO rules :) See the ISO Drafting Directives at:
>> > > >
>> > > >   http://anubis.dkuug.dk/JTC1/SC22/WG9/isodir3.pdf
>> > >
>> > > Thanks.
>> > >
>> > > 2nd question:
>> > >
>> > > Why the Standard has the coding guide(or design guide)?
<snip>
>> > > All the other part of the Standard has not such a kind describing.
>> > > For exam, there is no guideline for the Template usage.
>> > >
>> > > Why describing the container parts only has the guideline?
>> >
>> > I suspect that it is not the only part containing sentences that
>> > provide guidelines for the usage of various features of the language
>> > and the libraries.
>> >
>> 
>> For exam...?

You mean "example".

> 15.2p3: "So destructors should generally catch exceptions and not let
> them propagate out of the destructor."
<snip further examples>

Notice that all your examples are in notes.  This guideline about
container usage isn't, and that's the anomaly and I think Seungtai Kim
is right to question it.

AIUI the primary purpose of the standard is to specify what
implementations should do (1.1/1) and not what programmers should do. 
As programmers we would do well to restrict our programs to be
well-formed and to have defined behaviour according to the standard,
so far as possible, but we don't have quite the same obligation as
implementors.  (If we step outside what the standard defines, maybe
our program doesn't work properly, or maybe it does because we're
using an extension defined in another standard or by a particular
implementor.  If an implementor does that, thousands of programs can
break.  Of course the same can happen when an implementor "fixes"
longstanding non-conformant behaviour that programmers depend on
or work around.)

Guidance to programmers belongs in notes, if it belongs in the
standard at all.  By and large, programmers will not turn to the
standard for advice; they will read books like "Effective STL" which
gives a much better explanation of the purposes of the various
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                       ]



