How to get source code of C++ STL?


Is it free to get source code of C++ STL?
if yes, how to get it?

Thanks.
The LLVM libc++ implementation (clone): https://github.com/google/libcxx
The library code is in the include and src directories.

GNU libstdc++: https://gcc.gnu.org/viewcvs/gcc/trunk/libstdc%2B%2B-v3/

Microsoft: <Visual studio Install Directory>/include and <Visual studio Install Directory>/VC/crt/src/stl
(Opt for installing the CRT source code in the installer)

If the goal is to to understand how the standard library is implemented, wading through the code of an implementation is probably not the best way do it.

This is a good book:
'The C++ Standard Library: A Tutorial and Reference (2nd Edition)' by Nicolai M. Josuttis
https://www.amazon.com/Standard-Library-Tutorial-Reference-2nd/dp/0321623215

The 'Possible implementations' snippets (where available) in cppreference.com is another resource.
For example: http://en.cppreference.com/w/cpp/algorithm/search
Last edited on
Thanks very much for your kindly and detailed answer:).
Topic archived. No new replies allowed.