473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

STL Standards Document

RR
I have Plauger's book on STL and I've found that it's different from the STL
I have on a Linux box (libstdc++-2.96-112).

In particular, the map::erase(iterator) method I have returns nothing
(void), not "iterator".

So, does the latest C++ Standards document (INCITS/ISO/IEC 14882-2003)
contain the definitive current standard for STL and all its templates?

Is that the recommended document to find the correct STL semantics, or is
there a better document?

TIA,
RR
Jul 23 '05 #1
11 2547
"RR" <ne****************@spamgourmet.com> wrote in message
news:JJ****************@news-server.bigpond.net.au
I have Plauger's book on STL and I've found that it's different from
the STL I have on a Linux box (libstdc++-2.96-112).

In particular, the map::erase(iterator) method I have returns nothing
(void), not "iterator".

So, does the latest C++ Standards document (INCITS/ISO/IEC 14882-2003)
contain the definitive current standard for STL and all its templates?
Of course. You will find the following declaration for map on p.498:

void erase(iterator position);
Is that the recommended document to find the correct STL semantics,
or is there a better document?


Most people use Nicolai Josuttis: The C++ Standard Library. But the standard
is the definitive source.

--
John Carson

Jul 23 '05 #2
* RR:
I have Plauger's book on STL and I've found that it's different from the STL
I have on a Linux box (libstdc++-2.96-112).

In particular, the map::erase(iterator) method I have returns nothing
(void), not "iterator".
void erase( iterator position );
size_type erase( key_type const& x );
void erase( iterator first, iterator last );
So, does the latest C++ Standards document (INCITS/ISO/IEC 14882-2003)
contain the definitive current standard for STL and all its templates?
No, the C++ standards document contains the C++ standard, including the
C++ standard library, but referring to the C89 (?) standard for some pure
C things, including some pure C standard library things.

STL is not C++ (an early STL was originally implemented in Ada).

STL predates the standardization of C++ (it was the result of a bacterial
infection, while C++ was ... well); parts of STL are part of the C++
standard library; parts of STL, e.g. hash tables, are not.

Is that the recommended document to find the correct STL semantics, or is
there a better document?


For the C++ library: the C++ standard.

For STL: e.g.
<url: http://www.cs.utexas.edu/users/lavender/courses/stl/>.
<url: http://www.sgi.com/tech/stl/>
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 23 '05 #3
RR
Thanks. Just bought the standard and it's easier to read and clearer than
Plauger.

And, it answered all the questions are really needed to know right now!

Alf: thanks for the heads up on hashes, etc., but the URLs you provided are
way out of date (circa 1995). How valid do you think they are now with the
STL libraries that have been shipped in the last few years?

--
RR
Jul 23 '05 #4
RR wrote:
I have Plauger's book on STL and I've found that it's different from the STL
I have on a Linux box (libstdc++-2.96-112).
*Upgrade* to a later version. Pre-3.0 g++s are notoriously non standards
compliant.
In particular, the map::erase(iterator) method I have returns nothing
(void), not "iterator".

So, does the latest C++ Standards document (INCITS/ISO/IEC 14882-2003)
contain the definitive current standard for STL and all its templates?
Yes.
Is that the recommended document to find the correct STL semantics, or is
there a better document?


It is. The Dinkumware web site (http://www.dinkumware.com) also has a
good online reference.

HTH,
--ag

--
Artie Gold -- Austin, Texas
http://it-matters.blogspot.com (new post 12/5)
http://www.cafepress.com/goldsays
Jul 23 '05 #5
RR

"Artie Gold" <ar*******@austin.rr.com> wrote in message
news:3e************@individual.net...
It is. The Dinkumware web site (http://www.dinkumware.com) also has a
good online reference.


I checked that first, and it's wrong, just like the book (on
map::erase(iterator), for example).

--
RR
Jul 23 '05 #6
>I have Plauger's book on STL and I've found that it's different from the
STL
I have on a Linux box (libstdc++-2.96-112).
The book was published well before the standard was finalised.
So do not be surprised if some details vary.
They represent changes after the book was published but before the standard
was finalised.
The book has historical interest, but I would not rely on it as a definitive
authority on the C++ library
(and I doubt whether Plauger would want you to :-) )
So, does the latest C++ Standards document (INCITS/ISO/IEC 14882-2003)
contain the definitive current standard for STL and all its templates?
Yes.
Is that the recommended document to find the correct STL semantics, or is
there a better document?


It is the most authorative document but you might find other sources more
readable.

Stephen Howe
Jul 23 '05 #7
"RR" <ne****************@spamgourmet.com> wrote in message
news:mi****************@news-server.bigpond.net.au
"Artie Gold" <ar*******@austin.rr.com> wrote in message
news:3e************@individual.net...
It is. The Dinkumware web site (http://www.dinkumware.com) also has a
good online reference.


I checked that first, and it's wrong, just like the book (on
map::erase(iterator), for example).


It correctly describes the Dinkumware implementation, which in this respect
appears to diverge from the standard.

--
John Carson

Jul 23 '05 #8
* RR:
Thanks. Just bought the standard and it's easier to read and clearer than
Plauger.

And, it answered all the questions are really needed to know right now!

Alf: thanks for the heads up on hashes, etc., but the URLs you provided are
way out of date (circa 1995). How valid do you think they are now with the
STL libraries that have been shipped in the last few years?


Very.

The first link provides Stepanov's STL spec in Postscript and PDF (Stepanov
was the main author of the STL).

The second one is to the SGI implementation (again, Stepanov).

You can't get more accurate information than the original...

STL is not the C++ standard library, nor vice versa.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 23 '05 #9
RR wrote:

I checked that first, and it's wrong, just like the book (on
map::erase(iterator), for example).


It's not wrong, it's just ahead of its time. <g> At the last standards
committee meeting we changed iterator erases for associative containers
to return an iterator, just as they do for sequence containers.

--

Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)
Jul 23 '05 #10
Alf P. Steinbach wrote:
* RR:
Thanks. Just bought the standard and it's easier to read and clearer than
Plauger.

And, it answered all the questions are really needed to know right now!

Alf: thanks for the heads up on hashes, etc., but the URLs you provided are
way out of date (circa 1995). How valid do you think they are now with the
STL libraries that have been shipped in the last few years?

Very.

The first link provides Stepanov's STL spec in Postscript and PDF (Stepanov
was the main author of the STL).


I'm not so sure. I took a quick look at the pdf STL manual and noticed
that the section on Allocators makes no mention of the rebind mechanism.
Haven't there been important changes to the STL spec in the last ten
years?

Mark
The second one is to the SGI implementation (again, Stepanov).

You can't get more accurate information than the original...

STL is not the C++ standard library, nor vice versa.

Jul 23 '05 #11
RR

"Pete Becker" <pe********@acm.org> wrote in message
news:PP********************@rcn.net...
It's not wrong, it's just ahead of its time. <g> At the last standards
committee meeting we changed iterator erases for associative containers
to return an iterator, just as they do for sequence containers.


OK. Looks like I'll be able to use the book in a few years time! ;-)

TIA,
RR
Jul 23 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: MarionEll | last post by:
XML 2003 Interoperability Demonstrations to Showcase Industry Standards, Integrated Vendor Solutions Alexandria, VA – Nov. 19, 2003 – IDEAlliance, a leading trade association dedicated...
17
by: Ian | last post by:
Hi there, Can anybody tell me where I can find a standards documents like you have in c#. I am trying to write javascript and would like to know what standards are i.e. Where to put the...
2
by: John Doe | last post by:
I have a webpage which shows and hides divs as a method of navigation. It works great in the ever evil IE. It works not so great (read not at all) in any standards compliant browser. I haven't...
16
by: Rahul Behal | last post by:
Hi What are the various C Language standards? Where are they available on the internet?
115
by: junky_fellow | last post by:
What is a C object ? If i have some function "func()" in my C program, then can i say that "func()" is a C object ? or if i have some function pointer (ptr) which contains the address of...
9
by: Jason Gogela | last post by:
Does anyone out there know why I should care whether a <span> is nested in a <p> or vice versa? What is the bennafit of adhering to this standard? It seems to me that regardless of which way you...
2
by: kaczmar2 | last post by:
I have a webpage that has 2 main DIVs - a title div and a content div. I want the title dive to always "stick to the top of the page and not scroll, regardless of the size of the window. The...
15
by: Zhang Weiwu | last post by:
http://www.w3.org/MarkUp/2004/xhtml-faq provided a trick to serve xhtml webpage to IE as application/xml I used that trick and now every one of my xhtml webpage have following first 4 starting...
14
by: Sreenivas | last post by:
I want to know the standards document of the c++ language .Where can i get?? How different is c++ from vc++?
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.