How to get source code of C++ STL?

Aug 5, 2017 at 3:11am

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

Thanks.
Aug 5, 2017 at 4:16am
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 Aug 5, 2017 at 4:37am
Aug 5, 2017 at 10:01am
Thanks very much for your kindly and detailed answer:).
Topic archived. No new replies allowed.