tags:

views:

43

answers:

2

I am using GCC on cygwin, but I want to browse for source file of string.cpp from the standard library . I just want to read the source file for knowledge of the function I am using, but the problem is I can't find it anywhere. I only find the header files but not the source files. I assume it is store somewhere else, or maybe in another form? lib? dll? If so, then how can I extract that out..

Thx

+1  A: 

std::string is actually a template specialization of std::basic_string for the normal char type. Template C++ tends to end up solely in header files.

I haven't used the gcc library implementation, but there may well be no cpp files (or only files for implementing heavy lifting).

Pontus Gagge
+2  A: 

On my installation, it's located in the vicinity of:

/usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/string
/usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/bits/basic_string.h

to find this sort of stuff:

cd /usr
find . | grep string
Kaz Dragon
Does cygwin support `locate`? That's generally a better choice for large searches.
Stephen
Also `bits/basic_string.tcc` for the function implementations.
Mike Seymour