Archived

This topic is now archived and is closed to further replies.

STL Source

This topic is 5702 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok I can''t take it much longer... Is there ANY way to get the actual source for the STL? Instead of just all the function declarations? struct Geek {     void e_mail = belgedin@earthlink.net;     void url;     int age = 17; };

Share this post


Link to post
Share on other sites
The STL is distributed as source. It always has been because no compiler has supported export so far (yeah, yeah, Comeau).

Look in your include directories. Alternatively, download STL sources from SGI or STLPort.

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ ]
[ MS RTFM [MSDN] | SGI STL Docs | Boost ]
[ Google! | Asking Smart Questions | Jargon File ]
Thanks to Kylotan for the idea!

Share this post


Link to post
Share on other sites
Hi, Oluseyi.

Thanks for the links I''ll definitely check them out =)


>>>>>Look in your include directories.<<<<<

Yeah I''ve been look in there for a while (using Dev-C++ btw) All I can ever find is function declarations i.e. in the string.h file

char* strcpy (char* szCopyTo, const char* szSource);

I''ve already written a bunch of my own string functions (for learning purposes, not trying to reinvent the wheel here, I just want to "understand") but guess work isn''t going to work for the whole STL and I hate not understanding something that I''m using.

Hehe just noticed you''ve got the SGI link in your sig =)

struct Geek {
    void e_mail = belgedin@earthlink.net;
    void url;
    int age = 17;
};

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The string.h file does not belong to the STL, it is part of the POSIX part of your run time library.
The file "string" contains the std::string class. Note however that this source can be very unreadable at times.

Share this post


Link to post
Share on other sites
That's what I thought at first but then I couldn't find anything except string.h


EDIT>>>> Ok just did a "Find Files/Folders" search and located the STL string include. Thanks for all the help guys I really appreciate it.

>>>>>Note however that this source can be very unreadable at times.<<<<<

Yikes, you weren't kidding

struct Geek {
    void e_mail = belgedin@earthlink.net;
    void url;
    int age = 17;
};

[edited by - Xanth on May 7, 2002 1:34:52 PM]

[edited by - Xanth on May 7, 2002 1:45:00 PM]

Share this post


Link to post
Share on other sites
The fact that the STL is distributed as source does not mean that source is intended for prying eyes. This may become apparent when you browse the source, particularly if you have a commercial implementation of the STL. What is it you want with the source? Your needs might be better served by a good reference guide.


[ C++ FAQ Lite | ACCU | Boost | Python | Agile Manifesto! ]

Share this post


Link to post
Share on other sites
Like I said, I just want to understand why the things I'm using work. I don't like letting someone else do my work for me.

EDIT>> to amend that last statement what I really mean is I just don't like using something I don't understand. Ofcourse I don't want to write my own version of the STL. I just don't want something else doing for me what I couldn't do myself.

struct Geek {
    void e_mail = belgedin@earthlink.net;
    void url;
    int age = 17;
};

[edited by - Xanth on May 7, 2002 2:04:13 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by Xanth
Like I said, I just want to understand why the things I''m using work. I don''t like letting someone else do my work for me.

-> SGI STL site link in sig. Design docs, explanations, index, complete reference.

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ ]
[ MS RTFM [MSDN] | SGI STL Docs | Boost ]
[ Google! | Asking Smart Questions | Jargon File ]
Thanks to Kylotan for the idea!

Share this post


Link to post
Share on other sites
>>>>>-> SGI STL site link in sig. Design docs, explanations, index, complete reference.<<<<<

Yup, I've been reading through it since you gave me the link inyour first reply. That last comment was just a reply to SabreMan's post.

[edited by - Xanth on May 7, 2002 6:09:35 PM]

Share this post


Link to post
Share on other sites