Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is namespace std defined?

Tags:

c++

std

I want to take a peek inside of namespace std but, i'm not able to actually find the file on my computer where it is defined. I tried googling this but, i haven't had much luck.

like image 531
rage Avatar asked Apr 22 '14 20:04

rage


2 Answers

On most Unix systems, the C++ headers are usually stored in /usr/include/c++/<version>/, where <version> is the GCC/libstdc++ version (i.e. 4.9 or 4.9.2), or else the libc++ version i.e. v1.

Within that directory are all (or just most?) of the standard-mandated headers, which are mostly just ordinary C++ code. For libstdc++, note in particular that most of the older headers just include something in bits/; few of the C++11-specific headers do this.

like image 65
o11c Avatar answered Oct 01 '22 15:10

o11c


A list of every thing included in namespace std can be found here.

If you are using Visual Studio you can find it locally here : ~\Microsoft Visual Studio\VC\crt\src

There is also an online representation here.

NOTE : Edit the src files at your own risk, I'd recommend not editing them at all.

like image 38
hellyale Avatar answered Oct 01 '22 15:10

hellyale