I want to see source code of STL std::cout
function. I looked at iostream, but I've seen only "extern cout". So, I guess that it's defined somewhere in the library.
I downloaded source code from official site
I extracted it and did:
sh@sh-R528-R728:~/desktop/stl$ grep -F * | grep "cout"
but I got nothing.
What am I doing wrong? Where is the source code?
std::cout
is not a function, it's an object. That aside, try your luck with libc++ in iostream.cpp. – Maisiemaisonoperator<<
is what you are probably interested in. Search for that. – Cottastd::cout
is also not part of the STL. – Righthanderstd::cout
is just an object of typeostream
. You will find all of that in<ostream>
provided with your compiler. – Thorleystd::cout
is not a function; it is an instance ofstd::ostream
. It is not part of the SGI STL, but of the C++ Standard Library. This is why everybody calling [parts of] the Standard Library "the STL" is harmful. – Vanhouten