Topic: Vector should be used by default?


Author: stkim@yujinrobot.com ("Kim, Seungtai")
Date: Mon, 15 Mar 2004 18:37:04 +0000 (UTC)
Raw View
"Bill Wade" <wade@stoner.com> wrote in message news:2bbfa355.0403101207.36b3fe02@posting.google.com...
> stkim@yujinrobot.com ("Kim, Seungtai") wrote in message news:<c2lq2i$m3m$1@news.kreonet.re.kr>...
> > What is the intent of next statement? Coding guide? Encorage the usage of vector?
>
> >
> >     23.1.1/2
> >     ...vector is the type of sequence that should be used by default....
> >
>
> Coding guide.

Why it need at the Standard? Can I find the official documents about this or
other official ...?

> 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.

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

>
> The only common exception to this is that a vector's "wasted" space
> depends on the most number of elements that have ever been in the
> vector (or reserved).  This can be much larger than the "wasted" space
> in a list or deque.
>
> In http://www.gotw.ca/gotw/054.htm (which recommends deque, btw), no
> vector timing is even 50% slower than the faster of deque or list, but
> the "traverse" operation (iterator increment from begin() to end())
> for vector is over four times as fast as either deque or list.  These
> are old numbers.  YMMV.
>
> ---
> [ 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                       ]
>

--
S Kim <stkim@yujinrobot.com>


---
[ 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                       ]





Author: kuyper@wizard.net (James Kuyper)
Date: Mon, 15 Mar 2004 19:58:54 +0000 (UTC)
Raw View
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)?
> > > Is it needed for descriding the vector? Or it helps the developer or
> > > program?
> > > What the purpose..?
> >
> > Strictly speaking, it is not needed, because it says something that a
> > sufficiently bright reader could figure out just from reading the
> > detailed specifications for each of the standard sequences. However,
> > it's useful, because it saves the reader from having to figure that
> > out, and helps the reader place the detailed specifications in
> > context. Also, knowing what the purposes of the different standard
> > sequences were can help implementors figure out how to resolve design
> > choices that are not directly addressed by the details of the
> > specifications themselves.
>
> But, IMO, the Standard is too voluminous already. More explanation makes
> more voluminous. The C++ STD has 2 times more words than the C PL's.

Well, yes. The thing being described is at least two times more
complicated. My personal impression is the C standard contains most
(but not all) of the wording that is should contain, whereas the C++
standard could use a lot of filling out. This is perfectly
understandable, given the committee's limited resources. C++ is a
younger language than C, and a lot of the effort in C++98 went into
documenting features of the language and the library that didn't even
exist in ARM version of C++. I gather that this will also be true for
the next release. C99 had a much smaller percentage increase in
features, and the committee could therefore afford to spend more time
refining the descriptions of the existing features.

> It means tha it has possibility that it makes more people be extranged from the C++ PL.

I think a short, poor description will do a better job of estranging
people than a longer description, if that description is longer
because it's been made easier to understand.

> Many C++ PL books are presents for such a kinds description.
> Why the Standard also do it? If the statements is not needed, it should be removed.

Redundancy is essential for accurate communications. The standard
should avoid saying anything substantial twice, at least in normative
text, because that always leads to the problem of remembering to
change one of them to keep it consistent with the other.

However, an overview statement like this one merely makes the
following detailed specification easier to understand; it should not
be taken as a detailed specification itself, and therefore it should
not be interpreted as contradicting anything that is a detailed
specification.

..
> > > 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...?
15.2p3: "So destructors should generally catch exceptions and not let
them propagate out of the destructor."

24.1.1p3: "Algorithms on input iterators should never attempt to pass
throught the same iterator twice". 24.1.2p3 says the same for output
iterators.

25.2.1, footnote 251: "copy_backward(_lib.copy.backward_) should be
used instead of copy when last is in the range (result - (last-first),
result)

25.3.1.1, footnote 252: "If the worst case behavior is important
stable_sort()(25.3.1.2) or partial_sort()(25.3.1.3) should be used."

26.1p1: "If the distinction between initialization and assignment is
important for a class, or if it fails to satisfy any of the other
conditions listed above, the programmer should use vector(23.2.4)
instead of valarray for that class."

---
[ 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                       ]





Author: do-not-spam-benh@bwsint.com (Ben Hutchings)
Date: Wed, 17 Mar 2004 02:52:40 +0000 (UTC)
Raw View
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                       ]





Author: kuyper@wizard.net (James Kuyper)
Date: Wed, 17 Mar 2004 02:53:15 +0000 (UTC)
Raw View
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                       ]





Author: kuyper@wizard.net (James Kuyper)
Date: Wed, 17 Mar 2004 20:48:13 +0000 (UTC)
Raw View
do-not-spam-benh@bwsint.com (Ben Hutchings) wrote in message news:<slrnc5edoo.okv.do-not-spam-benh@shadbolt.i.decadentplace.org.uk>...
> 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")
..
> >> > > 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?
..
> 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.

That's a reasonable issue to raise; but my response was to a comment
which didn't make that distinction.

> AIUI the primary purpose of the standard is to specify what
> implementations should do (1.1/1) and not what programmers should do.

The standard is for both parties. It details how implementations and
programmers should work together. It tells implementors what rules
they can expect programmers to obey, and it tells programmers what
behavior they can count on from implementations, if those rulse are
obeyed.

---
[ 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                       ]





Author: stkim@yujinrobot.com ("Kim, Seungtai")
Date: Wed, 10 Mar 2004 03:58:51 +0000 (UTC)
Raw View
What is the intent of next statement? Coding guide? Encorage the usage of vector?

I can't catch the exact meaning of it.


    23.1.1/2
    ...vector is the type of sequence that should be used by default....


If I use the deque or list when it can be substituted by vector,
it is to be ill-formed program? Or is there any other criterion?

{
    std::deque<int> my_seq(10);
    my_seq[1] = 10;
    ...
}


Thanks in advice.

--
S Kim <stkim@yujinrobot.com>




---
[ 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                       ]





Author: kuyper@wizard.net (James Kuyper)
Date: Wed, 10 Mar 2004 15:57:55 +0000 (UTC)
Raw View
stkim@yujinrobot.com ("Kim, Seungtai") wrote in message news:<c2lq2i$m3m$1@news.kreonet.re.kr>...
> What is the intent of next statement? Coding guide? Encorage the usage of vector?
>
> I can't catch the exact meaning of it.
>
>
>     23.1.1/2
>     ...vector is the type of sequence that should be used by default....
>
>
> If I use the deque or list when it can be substituted by vector,
> it is to be ill-formed program? Or is there any other criterion?


It is a design guideline. The different standard sequences have
different complexity requirements, with corresponding differences in
the set of optional operations (Table 68) they're required to support,
and different specifications concerning the situations under which
iterators and references to contained objects become invalid.

Section 23.1.1p2 is an overview statement that describes the kinds of
situations in which each type of sequence should be the best one to
use. In so far as your code relies only on those features of sequences
that are described in section 23.1.1 paragraphs 1-11, (plus the
general container requirements that preceed them), you should get
equivalent results (with different speeds) no matter which kind of
sequence you use.

---
[ 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                       ]





Author: wade@stoner.com (Bill Wade)
Date: Wed, 10 Mar 2004 21:20:37 +0000 (UTC)
Raw View
stkim@yujinrobot.com ("Kim, Seungtai") wrote in message news:<c2lq2i$m3m$1@news.kreonet.re.kr>...
> What is the intent of next statement? Coding guide? Encorage the usage of vector?

>
>     23.1.1/2
>     ...vector is the type of sequence that should be used by default....
>

Coding guide.  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.

The only common exception to this is that a vector's "wasted" space
depends on the most number of elements that have ever been in the
vector (or reserved).  This can be much larger than the "wasted" space
in a list or deque.

In http://www.gotw.ca/gotw/054.htm (which recommends deque, btw), no
vector timing is even 50% slower than the faster of deque or list, but
the "traverse" operation (iterator increment from begin() to end())
for vector is over four times as fast as either deque or list.  These
are old numbers.  YMMV.

---
[ 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                       ]





Author: do-not-spam-benh@bwsint.com (Ben Hutchings)
Date: Thu, 11 Mar 2004 00:46:15 +0000 (UTC)
Raw View
"Kim, Seungtai" wrote:
> What is the intent of next statement? Coding guide? Encorage the
> usage of vector?
>
> I can't catch the exact meaning of it.
>
>
>     23.1.1/2
>     ...vector is the type of sequence that should be used by default....

I suppose it is a coding guideline - note the use of "should"
(advisory) instead of "shall" (mandatory).  I think it should really
be a note, since notes are non-normative.

> If I use the deque or list when it can be substituted by vector,
> it is to be ill-formed program?
<snip>

;-)

An ill-formed program is one that doesn't follow "the syntax rules,
diagnosable semantic rules, and the One Definition Rule" (1.3.14).
This guideline is not one of those rules.

---
[ 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                       ]





Author: stkim@yujinrobot.com ("Kim, Seungtai")
Date: Sat, 13 Mar 2004 18:19:49 +0000 (UTC)
Raw View
"Ben Hutchings" <do-not-spam-benh@bwsint.com>
> "Kim, Seungtai" wrote:
> > What is the intent of next statement? Coding guide? Encorage the
> > usage of vector?
> >
> > I can't catch the exact meaning of it.
> >
> >
> >     23.1.1/2
> >     ...vector is the type of sequence that should be used by default....
>
> I suppose it is a coding guideline - note the use of "should"
> (advisory) instead of "shall" (mandatory).  I think it should really
> be a note, since notes are non-normative.

How can I infer that the statements is just a guide?
Is there a part memtioned
that the Standard has the guide or any official documents?

[snip]

S Kim



---
[ 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                       ]





Author: gennaro_prota@yahoo.com (Gennaro Prota)
Date: Sun, 14 Mar 2004 00:17:28 +0000 (UTC)
Raw View
On Sat, 13 Mar 2004 18:19:49 +0000 (UTC), 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


--
Genny.

---
[ 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                       ]





Author: stkim@yujinrobot.com ("Kim, Seungtai")
Date: Sun, 14 Mar 2004 07:42:08 +0000 (UTC)
Raw View
"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)?
Is it needed for descriding the vector? Or it helps the developer or
program?
What the purpose..?

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?

S Kim


---
[ 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                       ]





Author: francis@robinton.demon.co.uk (Francis Glassborow)
Date: Sun, 14 Mar 2004 12:21:21 +0000 (UTC)
Raw View
In article <c30ttc$q8v$1@news.kreonet.re.kr>, "Kim, Seungtai"
<stkim@yujinrobot.com> writes
>2nd question:
>
>Why the Standard has the coding guide(or design guide)?
>Is it needed for descriding the vector? Or it helps the developer or
>program?
>What the purpose..?
>
>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 cannot comment on this specific case but the principle is that
sometimes there is behaviour that we would make Standard if we could but
for some reason we cannot (e.g. it would place too heavy a burden on
implementations for some hardware). In those cases ISO allows 'strong'
guidance by using 'should' rather than 'shall'. In addition footnotes
are sometimes used for clarification (as are examples) but carry no
normative weight.

--
Francis Glassborow      ACCU
Author of 'You Can Do It!' see http://www.spellen.org/youcandoit
For project ideas and contributions: http://www.spellen.org/youcandoit/projects

---
[ 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                       ]





Author: kuyper@wizard.net (James Kuyper)
Date: Sun, 14 Mar 2004 18:23:19 +0000 (UTC)
Raw View
stkim@yujinrobot.com ("Kim, Seungtai") wrote in message news:<c30ttc$q8v$1@news.kreonet.re.kr>...
> "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)?
> Is it needed for descriding the vector? Or it helps the developer or
> program?
> What the purpose..?

Strictly speaking, it is not needed, because it says something that a
sufficiently bright reader could figure out just from reading the
detailed specifications for each of the standard sequences. However,
it's useful, because it saves the reader from having to figure that
out, and helps the reader place the detailed specifications in
context. Also, knowing what the purposes of the different standard
sequences were can help implementors figure out how to resolve design
choices that are not directly addressed by the details of the
specifications themselves.

> 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.

---
[ 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                       ]





Author: stkim@yujinrobot.com ("Kim, Seungtai")
Date: Mon, 15 Mar 2004 15:56:59 +0000 (UTC)
Raw View
"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)?
> > Is it needed for descriding the vector? Or it helps the developer or
> > program?
> > What the purpose..?
>
> Strictly speaking, it is not needed, because it says something that a
> sufficiently bright reader could figure out just from reading the
> detailed specifications for each of the standard sequences. However,
> it's useful, because it saves the reader from having to figure that
> out, and helps the reader place the detailed specifications in
> context. Also, knowing what the purposes of the different standard
> sequences were can help implementors figure out how to resolve design
> choices that are not directly addressed by the details of the
> specifications themselves.

But, IMO, the Standard is too voluminous already. More explanation makes
more voluminous. The C++ STD has 2 times more words than the C PL's.
It means tha it has possibility that it makes more people be extranged from the C++ PL.
Many C++ PL books are presents for such a kinds description.
Why the Standard also do it? If the statements is not needed, it should be removed.

If the statements stands for "Design guide", I think that it also should be removed.
Because the statement has not enough (and not good) description. It just makes
confusion for designing. The designing is quite complex subject and it's not C++ PL's area.
The C++ PL need not to take part in it.

>
> > 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...?

Correct me if I was wrong.


S Kim


---
[ 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                       ]





Author: bop@gmb.dk ("Bo Persson")
Date: Mon, 15 Mar 2004 18:36:40 +0000 (UTC)
Raw View
""Kim, Seungtai"" <stkim@yujinrobot.com> skrev i meddelandet
news:c2lq2i$m3m$1@news.kreonet.re.kr...
> What is the intent of next statement? Coding guide? Encorage the usage of
vector?
>
> I can't catch the exact meaning of it.
>
>
>     23.1.1/2
>     ...vector is the type of sequence that should be used by default....
>
>
> If I use the deque or list when it can be substituted by vector,
> it is to be ill-formed program? Or is there any other criterion?
>

It's just a recommendation, if you don't know what container to use, use a
vector. It works fine in most cases.

If you have specific requirements that fit a deque or a list or a map
better, please use that. If not, try a vector.


Bo Persson


---
[ 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                       ]