Actual C++ Library Source Code

Discussion in 'C++' started by Tomás, Apr 11, 2006.

  1. Tomás

    Tomás Guest

    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
    }
    }


    -Tomás
     
    Tomás, Apr 11, 2006
    #1
    1. Advertising

  2. Tomás

    Marcus Kwok Guest

    "Tom?s" <> wrote:
    > Is there anywhere on the internet where you can download actual source
    > code of an implementation of the C++ library?


    I would imagine STLPort provides this:
    http://www.stlport.org/

    --
    Marcus Kwok
     
    Marcus Kwok, Apr 11, 2006
    #2
    1. Advertising

  3. Tomás

    Phlip Guest

    Tomás wrote:

    >
    > 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
    > }
    > }


    Besides STLport?

    --
    Phlip
    http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
     
    Phlip, Apr 11, 2006
    #3
  4. "Tomás" <> wrote:
    >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
    > }
    >}
    >-Tomás


    All 'big' open source operating systems make available the full source
    code for their libraries. Go to the web sites for any Linux
    distribution, NetBSD, FreeBSD, OpenBSD, minix, OpenSolaris, etc.
    For the STL in particular, search for STLport.
     
    Roberto Waltman, Apr 11, 2006
    #4
  5. Tomás

    red floyd Guest

    Phlip wrote:
    > Tom�s wrote:
    >
    >> 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
    >> }
    >> }

    >
    > Besides STLport?
    >


    Well, there's GNU as well...
     
    red floyd, Apr 11, 2006
    #5
  6. Bronek Kozicki, Apr 11, 2006
    #6
  7. Phlip wrote:
    > Tom�s wrote:
    >
    >> 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
    >> }
    >> }

    >
    > Besides STLport?


    Although it's not free, the Digital Mars C++ compiler CD comes with full
    library source code. For a free version, there is of course the gnu
    implementation.

    -Walter Bright
    www.digitalmars.com C, C++, D programming language compilers
     
    Walter Bright, Apr 11, 2006
    #7
  8. Tomás

    Daniel T. Guest

    In article <GOO_f.8049$>,
    "Tomás" <> wrote:

    > 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
    > }
    > }


    I can't believe no one mentioned this one.
    <http://www.sgi.com/tech/stl/>

    It's based on Hewlett-Packard's original code (as is gnu's version I
    believe...)


    --
    Magic depends on tradition and belief. It does not welcome observation,
    nor does it profit by experiment. On the other hand, science is based
    on experience; it is open to correction by observation and experiment.
     
    Daniel T., Apr 11, 2006
    #8
  9. "Daniel T." <> wrote:
    > "Tomás" <> wrote:
    >> Is there anywhere on the internet where you can download actual source
    >> code of an implementation of the C++ library? Stuff like:

    >
    >I can't believe no one mentioned this one.
    ><http://www.sgi.com/tech/stl/>
    >
    >It's based on Hewlett-Packard's original code (as is gnu's version I
    >believe...)


    I always thought of STLport, (that I and others mentioned,) as a
    better, more up-to-date version of SGI's STL, on which it is based.

    Are there any reasons to prefer SGI's STL over STLport?
     
    Roberto Waltman, Apr 11, 2006
    #9
  10. Tomás

    Daniel T. Guest

    In article <>,
    Roberto Waltman <> wrote:

    > "Daniel T." <> wrote:
    > > "Tomás" <> wrote:
    > >> Is there anywhere on the internet where you can download actual source
    > >> code of an implementation of the C++ library? Stuff like:

    > >
    > >I can't believe no one mentioned this one.
    > ><http://www.sgi.com/tech/stl/>
    > >
    > >It's based on Hewlett-Packard's original code (as is gnu's version I
    > >believe...)

    >
    > I always thought of STLport, (that I and others mentioned,) as a
    > better, more up-to-date version of SGI's STL, on which it is based.
    >
    > Are there any reasons to prefer SGI's STL over STLport?


    I'm thinking that Tomas wants to study the code to see how it works and
    I expect that SGI's version is probably simpler than STLport (though I
    could be wrong, I see now that SGI does still revise theirs.)

    I think it would be most instructive for Tomas to try to implement his
    own STL. :)


    --
    Magic depends on tradition and belief. It does not welcome observation,
    nor does it profit by experiment. On the other hand, science is based
    on experience; it is open to correction by observation and experiment.
     
    Daniel T., Apr 12, 2006
    #10
  11. Tomás

    Guest

    Tomás wrote:
    > 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.

    Of course, many commercial compilers also include the actual sources of
    their standard C++ libraries. Have you looked at yours?

    HTH,
    Michiel Salters
     
    , Apr 13, 2006
    #11
  12. Tomás

    P.J. Plauger Guest

    <> wrote in message
    news:...

    Tomás wrote:
    > 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.)
    ---

    Of course, many commercial compilers also include the actual sources of
    their standard C++ libraries. Have you looked at yours?

    ---
    [pjp] Good suggestion.
    ---

    P.J. Plauger
    Dinkumware, Ltd.
    http://www.dinkumware.com
     
    P.J. Plauger, Apr 13, 2006
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eyal Bekerman
    Replies:
    2
    Views:
    426
    Steven Coco
    Oct 10, 2003
  2. Russell Wallace
    Replies:
    7
    Views:
    416
    Russell Wallace
    Jun 11, 2004
  3. John Gabriele
    Replies:
    0
    Views:
    872
    John Gabriele
    Oct 30, 2003
  4. Replies:
    3
    Views:
    272
    Dietmar Kuehl
    Mar 19, 2006
  5. DJ Stunks
    Replies:
    0
    Views:
    348
    DJ Stunks
    Feb 10, 2007
Loading...

Share This Page