views:

465

answers:

6

I have spent the last several years fighting tooth and nail to avoid working with C++ so I'm probably one of a very small number of people who likes systems programming and template meta programming but has absolutely no experience when it comes to the STL and very little C++ template experience.

  • Does anyone know of a good document for getting started using STL?

I'd prefer PDF or something else I can kill trees with and I'm looking for something more along the lines of a reference than a tutorial (although an 80/20 split would be nice there).


I ended up using the docs from here, pringing them out via a PDF driver and tacking them together with this idea. Now I'm off to print them off 2-up double sided (190 pages even so, but I have >1k pages in my quota and only 4 months till graduation).

+8  A: 
AraK
that and sgi's documentation mentioned by Conspicious Compiler in the comment above.
Michael Krelin - hacker
My personal recommendation is to stay away from cplusplus.com. I have repeatedly encountered outdated or simply factually incorrect information there. SGI or g++ docs are far preferrable.
Pavel Minaev
@hacker I find SGI documentation comprehensive but very hard to follow. In addition, SGI docs contain some stuff that are not part of the standard library.
AraK
@Pavel I removed 'up to date' from cplusplus description. Though I find it the easiest to read :)
AraK
Unless the link to C++03 standard is to the most recent draft (and not a final version), it is most likely an unauthorized copy. ISO (and ANSI) charge money for electronic version of the standard, and do not permit redistribution.
Pavel Minaev
@Pavel Link removed I thought it is a draft.
AraK
And not little money :) http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=38110
Skurmedel
@Pavel, i also recommend everyone to stay away from cplusplus.com . SGI ftw :)
Johannes Schaub - litb
http://www.open-std.org/jtc1/sc22/wg21/ You can find the drafts here.
Skurmedel
@Skurmedel: INCITS (successor to ANSI) is a lot cheaper, $18 when I bought my copy.
MSalters
Oh, nice MSalters, that's nice price actually. Just had a look and it's $30 now, no where near 350 swiss francs.
Skurmedel
+2  A: 

In general, it is best to use the documentation that comes with your C++ toolchain. For general-purpose docs, I like the GNU libstdc++ documentation.

If you're looking for a proper reference, then, truly, nothing can beat "ISO/IEC 14882:2003 - Programming Language C++" - after all, it's the primary source. I'm not aware of any legal way to get the PDF for that for free. You can buy the PDF from ISO, but they ask ~$300 for that, way too much in my opinion. A cheaper option is to go to one of the national standard bodies that make ISO - they republish those standards under their own name (but otherwise unchanged), and usually the prices are more sane. The cheapest paper version I'm aware of is published by British Standards Institute - available on Amazon for $85. The cheapest download PDF seems to be $40 from the shop of the Australian member organization.

Pavel Minaev
the docs I have are man pages. They will work well once I know what I'm looking for but and I want something I can brows more easily to *find* what I should be looking for.
BCS
Pavel, the C++ Standard PDF does not cost $300, you can get it for much cheaper. I got it for $18 but I think they recently raised the price to around ~$40. If you want a printed copy of the PDF, that's when they charge several hundred dollars.
Brian Neal
Please re-read my answer carefully :)
Pavel Minaev
Nice edit, but it still says $300 for a PDF. The PDF is actually $30 here: http://webstore.ansi.org/RecordDetail.aspx?sku=INCITS%2fISO%2fIEC+14882-2003This link was found by reading Stroustrups FAQ: http://www.research.att.com/~bs/bs_faq.html#machine-readable-standardHowever I'm not sure I would recommend the C++ standard as a day-to-day reference for using the STL.
Brian Neal
No edits. And look at the link in the very last sentence of my post - it's $30.00 for a PDF, not $300. Though you're right in that it seems that ANSI version is just as cheap. As for recommendation itself... I believe that once you get past the stage where you need a textbook, the perfect reference is the primary source.
Pavel Minaev
+4  A: 

Here is the reference I'm using. SGI

Here is another reference

Maciek
I use the SGI reference as well. It's worth noting that SGI makes an offline copy of the documentation available for download (bottom of http://www.sgi.com/tech/stl/download.html)
Boojum
+9  A: 

If you want dead trees, maybe you'd be better off with a proper book? I found this one indispensable: The C++ Standard Library: A Tutorial and Reference by Nicolai M. Josuttis

Mark Ransom
+1: That book is my STL bible.
Rob
+1  A: 

If you are going to do C++, then you need the book "The C++ Programming Language" by Stroustrup. It makes an excellent reference to the STL. I refer to it all the time for all things related to algorithms and containers.

If you need more of a hands-on tutorial approach, then try the Josuttis book as recommended by Mark Ransom.

Brian Neal
I've see Stroustrup's book. IIRC it's not primarily an STL ref and that's what I'm looking for.
BCS
Well, it isn't *primarily* a STL reference. It's a reference for C++, which also includes the STL. You should own this if you are doing C++ and it will provide the reference you need.
Brian Neal
A: 

And once you are done reading all the references suggested here, be sure to take a look at "Effective STL" by Scott Meyers.

Dima