Hello,

Where can I find the source code/implementations of STL library? Thanks.

Recommended Answers

All 4 Replies

You already have it!!

If you are using linux and you have development environment setup then you will find it in the :
/usr/include/c++

In windows I dont know exact location, but you should still able to browse it from any IDE.
Just include the header file and click on it, it should take you to the library file.

The STL stands for Standard Template Library. Like any other template library, it is a header-only library (except for some low-level things, maybe). You already have the source if you have the headers, just look for them. Under linux, they will be either in /usr/include/c++ or /usr/local/include/c++. Under windows, it will depend on your compiler's installation, should not be very hard to find (make a file-search for any one of the STL header files).

Otherwise, you can get the STL source from SGI (original developer of STL).
Or, you can get GCC's implementation of the standard libraries as part of the source distribution of GCC.

Good luck reading those header files :) I tried once to read MS-Windows implementation of iostream and gave up because it was so complicated.

iostream would be definitely tough one to start with.
I would suggest to see some easier(!) one first.
Like list, string, vector. I think if you can understand these three, would cover lots of basic and advanced c++ concepts.
Then the Algorithms.
Best of luck. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.