Tomás said:
Is there anywhere on the internet where you can download actual source
code of an implementation of the C++ library? Stuff like:
namespace std {
class string {
// actual code in here
}
}
The GNU C++ library is probably the only option. Some other posts
mention
STLPort, but it's rather incomplete. It assumes that a large port of
the
C++ library is already present, and adds Standard Templates to the
Library
(Hence the "STL" in STLPort). For instance, std::string is
template-based
( basic_string<char> ) and is in STLPort; std::strlen() isn't.
---
[pjp] Actually, the two libraries have comparable coverage. Libstdc++
(the library shipped with gcc) is just the C++ part. It depends on
whatever local C library is provided by the OS. In the case of Linux,
that happens to be glibc, the (more or less) Standard C library that's
also part of Project GNU. On Solaris, it uses the C library from Sun.
On the Mac OS it's the FreeBSD C library. etc. etc. STLport does
essentially the same thing. (And hence, both libraries are missing
many of the additions to the C library mandated by the C++ Standard.)
Libstdc++ is designed to work only with gcc, while STLport endeavors
to some degree of portability. OTOH, Libstdc++ is still actively
maintained, while STLport has been in the doldrums for the past
several years. (In fact, the STLport support forums went "offline
for maintenance" about a month ago and never came back. What's left
of the volunteer maintenance effort can now be found on SourceForge.)