tags:

views:

161

answers:

6

Where can I see all the available methods in std library ? Since, I can include vector,algorithm in my program, can I see header/source files for this library to see how it is implemented ?

eg. I know we can use push_back() method in vector, but where can I see all the methods for vector, and similarly for others library ?

Is there any documentation for it ?

I am using ubuntu, if this helps.

+1  A: 

This web site has a lot of the things you're looking for : C++ STL Vector

There are a lot of books and web sites on the subject. Googling for STD or STL library will give you a world of links

Here is a list of containers

Here is a list of algorithms

Salgar
+1  A: 

CPP Reference

other references might be useful depending on the platform you're implementing ( like MSDN for Windows )

da_m_n
MSDN's reference is fine regardless of which platform you're working on. It describes the library according to spec, and clearly marks Microsoft-specific extensions. And it's a lot more complete and thorough than cppreference.com in my experience
jalf
I didn't say it isn't complete - this is why I've put it there - but it contains also the MS-specific additions (which are not standard and not portable - either between platforms or even between compilers on the same platform ).
da_m_n
+3  A: 

Linux developers often use http://www.cplusplus.com as documentation source. But to completely understand how to work with STL I recommend to read Effective STL by Scott Meyers.

One more way is to use man pages. Install documentation with:

sudo apt-get install libstdc++6-4.2-doc

After that you'll be able to read documentation with command man:

man std::vector
Kirill V. Lyadvinsky
Very good tip! I've rushed on my ubuntu box to install it, the 6.4.3 package version does not seems to contain any man files ... ? Prefer the 6.4.2 version as mentioned by Jla3ep (I'll try later..)
yves Baumes
I've just tested it on 6.4.3 - it doesn't work indeed.
Kirill V. Lyadvinsky
+4  A: 

If you want to check the source out, have a look into /usr/include/c++/x.x/vector

you'll probable need to redirect your research in this directory (depeding on the class you are looking at): /usr/include/c++/x.x/bits

For instance, string class is a typedef, and the underlying type is basic_string you will find in /usr/include/c++/x.x/bits/basic_string

yves Baumes
+3  A: 

Dinkumware reference.

STL reference from SGI.

KTC
Also the C++ standard, available from bookshops.
Steve Jessop
+2  A: 

Alexander Stepanov created the STL while employed at HP. This is the original documentation of his work, now hosted at Sgi, and probably the most used reference.

fnieto