It's in the libstdc++-v3 directory in the g++ (gcc-c++) sources.
How to get source code of C++ STL? - C++ Forum
How to find source code for standard library functions?
c++ - Where can I get a copy of the file libstdc++.so.6.0.15 - Stack Overflow
visual c++ - Where to get the source code for the C++ standard library? - Stack Overflow
How would I go about finding the actual code to the standard library functions. I know the point is that you dont need to know then, but I just wanna see what tings like the sqrt function holds and how std::unordered_map works. I read somewhere that it’s different based on your OS and compiler, but where do I find the one my machine uses?
You shouldn't have to manually download this library, if you're on Ubuntu Linux, it should be shipped inside this package :
sudo apt-get install libstdc++6
If you already have libstdc++6, then the problem is elsewhere and you should explain what you're trying to achieve in the first place.
If you want a newer version of libstdc++6 than the one provided in the default package, then you can try to update to the toolchain test package :
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
Otherwise you would have to compile GCC from source :
- Install the prerequisite (using
sudo apt-get build-dep gcc-4.7as instance) - Get the source from GNU.org
- Compile it using
configure,makeandmake install
Just realized that was having the similar problem some time ago. Disclaimer: If you know what you are doing, check this repository - Index of /debian/pool/main/g/gcc-4.7. It must be in some of the packages available. Use Archive Manager to get inside.
The GNU project is Free and Open Source software, and contains an implementation of the C++ standard library.
http://gcc.gnu.org/libstdc++/
You should already have the sources in your compiler installation. If you are using an IDE with a "jump to include file" command, select any STL header and jump to it. If you are using some kind of UNIX, look in /usr/include/c++. See where that STL header includes other headers and recurse :v) .