c++ stl

Discussion in 'C++' started by ramtin, Feb 18, 2011.

  1. ramtin

    ramtin Guest

    hi all ,
    i want to learn stl c++ programing .
    but i actully dont know what stl really is (?)
    if any one know a good text book for it plz send it links for me .
    and i want to code one of it function in c programing which one do you
    think is good for me (to code it) as i am new at this . . .
    thanks of all
     
    ramtin, Feb 18, 2011
    #1
    1. Advertising

  2. ramtin

    MiB Guest

    On Feb 18, 8:22 am, ramtin <> wrote:
    > i want to learn stl c++ programing .
    > but i actully dont know what stl really is (?)


    The STL or "Standard Template Library" is a collection of template
    classes and functions. For me, it helps most to shift my focus in
    application programmers from dealing with low-level implementation
    details to addressing the actual problem I need to solve. The STL
    covers containers (vectors, lists, sets, associative maps, ...),
    character strings, algorithms (sorting, searching, aggregation, ...),
    and more. It is part of the C++ standard, so anything you code using
    the defined interface of the STL works with any standard complying C++
    compiler.

    > if any one know a good text book for it plz send it links for me .


    I would like to recommend you the excellent introduction to the STL by
    Stephan T. Lavavej, available as a ten-part video lecture here:
    http://channel9.msdn.com/Shows/Going Deep/C9-Lectures-Introduction-to-STL-with-Stephan-T-Lavavej
    Aside from being a real expert on the STL, Mr. Lavavej is a hard to
    find talent at teaching. I personally enjoy watching his lectures a
    lot. It is a wonderful contrast to these horrible "dialog-style" shows
    (Tom: "We have this really cool thing here, that will make everybody's
    life just perfect, what do you think, Bob?" --- Bob: "Yeah, Tom, this
    is so great...", over and over, with no actual information conveyed.)

    Since he is an Microsoft employee, and Microsoft is sponsoring the
    lectures, the presentation is somewhat centered around Visual C++
    2010. However, any examples and code shown do not depend on the
    Windows operating system or Microsoft IDEs, and should work on Linux /
    g++ or other standard compliant compilers without, or minimal change.
    Plus, watching the show is free, so I won't complain on some product
    placement commercial.

    > and i want to code one of it function in c programing which one do you
    > think is good for me (to code it) as i am new at this . . .


    I'd recommend to start a project around a problem from *your* personal
    life; something where you feel expert at, or have a hobby interest
    anyway. Do you collect bottle caps? Go on, create a program that keeps
    track of your 10,000+ exhibits and growing collection. Do you do some
    team sports? How about a match making or tournament administration
    software? Do you work at a pizza restaurant? Make a pizza order by
    internet software. You have an old pocket calculator you used at
    school? Create a simulation of it. There is plenty of ideas from your
    environment, so you don't need to look out for projects thousands of
    programmers solved already ad nauseam. I'd find it very hard to come
    up with a practical problem where the STL would not be of use.

    just my $.02,

    MiB.
     
    MiB, Feb 18, 2011
    #2
    1. Advertising

  3. ramtin

    K4 Monk Guest

    On Feb 18, 12:22 pm, ramtin <> wrote:
    > hi all ,
    > i want to learn stl c++ programing .
    > but i actully dont know what stl really is (?)
    > if any one know a good text book for it plz send it links for me .
    > and i want to code one of it function in c programing which one do you
    > think is good for me (to code it) as i am new at this . . .
    > thanks of all


    I am a C++ newbie and my understanding is this:

    STL = Standard Template Library....the keyword here is "Template".

    Basically there are many operations and data structures which are very
    common in the programming world and they only way their implementation
    differs is through the types of objects they manipulate. So, for
    example one implementation could manipulate a queue of "Battleships"
    and another implementation could have "Teacups", but at their core,
    they are both "queues".

    The STL is a project which has factored out the common theme among
    many such data structures, so that with a little tweaking you can
    create your own data structures and generic containers without
    reinventing the wheel.

    So for example, instead of doing the following:

    class integerLinkedList { };
    integerLinkedList l1;

    class charLinkedList { };
    charLinkedList l2;

    you can do:

    list<int> l1;
    list<char> l2;

    and you can have the same universal operations available for both
    objects
     
    K4 Monk, Feb 18, 2011
    #3
  4. ramtin

    Rui Maciel Guest

    Pete Becker wrote:

    > MiB is correct, but note that many people use "STL" to refer to the C++
    > STandard Library.
    >


    The C++ standard library encompasses a bit more components than the
    STL[1]. If "many people" refer to the C++'s standard library as "STL"
    then "many people" are making a mistake.


    Rui Maciel

    [1] http://en.wikipedia.org/wiki/C++_Standard_Library
     
    Rui Maciel, Feb 18, 2011
    #4
  5. ramtin

    Rui Maciel Guest

    Leigh Johnston wrote:

    > Mistake? not at all; the meaning of words and abbreviations can change
    > over time. These days when somebody says "STL" they often are referring
    > to the C++ Standard Library rather than the original Standard Template
    > Library which includes stuff that is not part of currently standardized
    > C++ Standard Library.


    The meaning of "STL" can only "change over time" to be understood as the
    C++ standard library if the mistake of confusing the Standard Template
    Library with the C++ standard library is reiterated and perpetuated over
    time.


    Rui Maciel
     
    Rui Maciel, Feb 18, 2011
    #5
  6. ramtin

    Paul Guest

    "Rui Maciel" <> wrote in message
    news:4d5ef3fa$0$24801$...
    > Leigh Johnston wrote:
    >
    >> Mistake? not at all; the meaning of words and abbreviations can change
    >> over time. These days when somebody says "STL" they often are referring
    >> to the C++ Standard Library rather than the original Standard Template
    >> Library which includes stuff that is not part of currently standardized
    >> C++ Standard Library.

    >
    > The meaning of "STL" can only "change over time" to be understood as the
    > C++ standard library if the mistake of confusing the Standard Template
    > Library with the C++ standard library is reiterated and perpetuated over
    > time.
    >
    >

    Quite true.
     
    Paul, Feb 18, 2011
    #6
  7. ramtin

    James Kanze Guest

    On Feb 18, 9:52 pm, Rui Maciel <> wrote:
    > Pete Becker wrote:
    > > MiB is correct, but note that many people use "STL" to refer
    > > to the C++ STandard Library.


    > The C++ standard library encompasses a bit more components
    > than the STL[1]. If "many people" refer to the C++'s standard
    > library as "STL" then "many people" are making a mistake.


    The C++ standard library is largely a "template" library. And
    if a library is "standard", and it is "template", how can
    calling it a "standard template library" be a mistake. (One
    could argue that calling Stepanov's library a "standard template
    library" is misleading advertising, because it certainly wasn't
    "standard". At least in the sense that ISO uses "standard".)

    The actual meaning of a word depends on common usage, which
    means that in this regard, "most people" can never be wrong, In
    practice, the usage that I've seen most frequently (but far from
    exclusively) would use STL for the parts of Stepanov's library
    that were adopted by ISO (but not the other parts), plus
    elements of the C++ standard library, like std::basic_string,
    which have been STLized. Although the limits are not precise,
    this would exclude things like iostream and operator new, but
    include basic_string, and perhaps other elements, that weren't
    in Stepanov's library. But as I say, the limits are not
    precise, and not a few people would include the entire standard
    C++ library. If you need to be precise, I'd avoid the term STL.

    --
    James Kanze
     
    James Kanze, Feb 18, 2011
    #7
  8. ramtin

    James Kanze Guest

    On Feb 18, 10:34 pm, Rui Maciel <> wrote:
    > Leigh Johnston wrote:
    > > Mistake? not at all; the meaning of words and abbreviations can change
    > > over time. These days when somebody says "STL" they often are referring
    > > to the C++ Standard Library rather than the original Standard Template
    > > Library which includes stuff that is not part of currently standardized
    > > C++ Standard Library.


    > The meaning of "STL" can only "change over time" to be understood as the
    > C++ standard library if the mistake of confusing the Standard Template
    > Library with the C++ standard library is reiterated and perpetuated over
    > time.


    Which is, or has been, the case. As Leigh says, language
    evolves, and today, the exact meaning of STL depends on who is
    talking---in other words, the acronym doesn't have an exact
    meaning. In many ways, Humpty Dumpty is right. "When I use a
    word, it means just what I choose it to mean." Of course, if I
    choose something very different from what other people
    understand, communication is rendered significantly more
    difficult, but in the end, each speaker chooses his or her
    vocabulary according to their personal beliefs. And when the
    personal beliefs of a majority of a liguistic group change, the
    generally accepted meaning changes.

    --
    James Kanze
     
    James Kanze, Feb 18, 2011
    #8
  9. ramtin

    James Kanze Guest

    On Feb 18, 11:02 pm, Leigh Johnston <> wrote:
    > On 18/02/2011 22:34, Rui Maciel wrote:


    > > Leigh Johnston wrote:


    > >> Mistake? not at all; the meaning of words and abbreviations
    > >> can change over time. These days when somebody says "STL"
    > >> they often are referring to the C++ Standard Library rather
    > >> than the original Standard Template Library which includes
    > >> stuff that is not part of currently standardized C++
    > >> Standard Library.


    > > The meaning of "STL" can only "change over time" to be
    > > understood as the C++ standard library if the mistake of
    > > confusing the Standard Template Library with the C++
    > > standard library is reiterated and perpetuated over time.


    > Shit happens.


    :)

    Which is a very succinct summary of what I said in a lot more
    words:).

    --
    James Kanze
     
    James Kanze, Feb 18, 2011
    #9
  10. ramtin

    Jorgen Grahn Guest

    On Fri, 2011-02-18, James Kanze wrote:
    > On Feb 18, 9:52 pm, Rui Maciel <> wrote:
    >> Pete Becker wrote:
    >> > MiB is correct, but note that many people use "STL" to refer
    >> > to the C++ STandard Library.

    >
    >> The C++ standard library encompasses a bit more components
    >> than the STL[1]. If "many people" refer to the C++'s standard
    >> library as "STL" then "many people" are making a mistake.

    >
    > The C++ standard library is largely a "template" library.


    I think of it as three parts: the C library (which is a quite large
    part!), the parts from (or compatible with) the original STL
    (containers, iterators and algorithms), and some other stuff
    (iostreams, locales, possibly std::string ...).

    Personally, when I say STL (which is rarely) I mean the second part.
    You'd never hear me claim std::printf is part of the STL.

    /Jorgen

    --
    // Jorgen Grahn <grahn@ Oo o. . .
    \X/ snipabacken.se> O o .
     
    Jorgen Grahn, Feb 19, 2011
    #10
  11. ramtin

    MiB Guest

    Congratulations, folks. It took only three posts in this thread (OP,
    my answer, and the riposte) to bazooka a beginner's request for
    pointers to study material into a completely pointless vivisection of
    the three letter acronym STL.

    MiB.
     
    MiB, Feb 19, 2011
    #11
  12. ramtin

    Adrian Guest

    On 2/18/2011 12:22 AM, ramtin wrote:
    > hi all ,
    > i want to learn stl c++ programing .
    > but i actully dont know what stl really is (?)
    > if any one know a good text book for it plz send it links for me .
    > and i want to code one of it function in c programing which one do you
    > think is good for me (to code it) as i am new at this . . .
    > thanks of all

    A excellent book I've had for many years is

    The C++ Standard Library: A Tutorial and Reference by Nicolai M. Josuttis


    Adrian
     
    Adrian, Feb 19, 2011
    #12
  13. ramtin

    Rui Maciel Guest

    Leigh Johnston wrote:

    >> The meaning of "STL" can only "change over time" to be understood as
    >> the C++ standard library if the mistake of confusing the Standard
    >> Template Library with the C++ standard library is reiterated and
    >> perpetuated over time.
    >>

    >
    > Shit happens.


    Yes, it does. Yet, that doesn't mean that refering to the C++ standard
    library as "the STL" makes sense, nor does it justify reiterating a
    flagrant error. So, using your expression, shit may happen but that
    doesn't give anyone the right to not only intentionally make it but also
    spread it around.


    Rui Maciel
     
    Rui Maciel, Feb 19, 2011
    #13
  14. ramtin

    Paul Guest

    "Rui Maciel" <> wrote in message
    news:4d5f1678$0$24788$...
    > Leigh Johnston wrote:
    >
    >>> The meaning of "STL" can only "change over time" to be understood as
    >>> the C++ standard library if the mistake of confusing the Standard
    >>> Template Library with the C++ standard library is reiterated and
    >>> perpetuated over time.
    >>>

    >>
    >> Shit happens.

    >
    > Yes, it does. Yet, that doesn't mean that refering to the C++ standard
    > library as "the STL" makes sense, nor does it justify reiterating a
    > flagrant error. So, using your expression, shit may happen but that
    > doesn't give anyone the right to not only intentionally make it but also
    > spread it around.
    >
    >

    I think some people don't care if it's correct because it's not important
    enough for them to bother. I agree it isn't correct to refer to the std lib
    as STL, and I'm sure little things like this are important to people who are
    trying to learn and learn things properly.
     
    Paul, Feb 19, 2011
    #14
  15. ramtin

    Richard Guest

    [Please do not mail me a copy of your followup]

    Adrian <> spake the secret code
    <ijn4ia$led$-september.org> thusly:

    >A excellent book I've had for many years is
    >
    >The C++ Standard Library: A Tutorial and Reference by Nicolai M. Josuttis


    +1
    --
    "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
    <http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

    Legalize Adulthood! <http://legalizeadulthood.wordpress.com>
     
    Richard, Feb 19, 2011
    #15
  16. ramtin

    Rui Maciel Guest

    MiB wrote:

    > Congratulations, folks. It took only three posts in this thread (OP,
    > my answer, and the riposte) to bazooka a beginner's request for
    > pointers to study material into a completely pointless vivisection of
    > the three letter acronym STL.


    If you believe it's pointless then you failed to understand the problem.
    It's impossible to provide any decent pointers on a particular topic if
    some people don't know what's the topic. In this case, if people mistake
    the STL with the C++ standard library then they can do the newbie a
    disservice by suggesting that he reads on C++'s streams or on the C
    standard library. If the newbie is in fact looking for the Standard
    Template Library stuff, which means the generic containers and all those
    algorithms that go with them, then those referring to the complete C++
    standard library are effectively wasting his time.


    Rui Maciel
     
    Rui Maciel, Feb 19, 2011
    #16
  17. ramtin

    Rui Maciel Guest

    Pete Becker wrote:

    > Ah yes, citing the infallible wikipedia.


    You are free to fix any mistake that the article carries. What mistakes
    have you found so far?


    Rui Maciel
     
    Rui Maciel, Feb 19, 2011
    #17
  18. ramtin

    Rui Maciel Guest

    James Kanze wrote:

    > Which is, or has been, the case. As Leigh says, language
    > evolves, and today, the exact meaning of STL depends on who is
    > talking---in other words, the acronym doesn't have an exact
    > meaning.


    The acronym doesn't have an exact meaning only to those who don't know
    what the Standard Template Library is.


    > In many ways, Humpty Dumpty is right. "When I use a
    > word, it means just what I choose it to mean." Of course, if I
    > choose something very different from what other people
    > understand, communication is rendered significantly more
    > difficult, but in the end, each speaker chooses his or her
    > vocabulary according to their personal beliefs. And when the
    > personal beliefs of a majority of a liguistic group change, the
    > generally accepted meaning changes.


    If we look at this as a semantics issue then the only case that we can
    make is that the meaning of an expression can change over time. This is
    not the same as claiming that the meaning of an expression should change
    over time. In this case, just because some people fail to know the
    meaning of STL, either due to confusion or because they simply never
    learned what it meant, it doesn't give them the right to perpetuate their
    mistakes, particularly those based on ignorance that are subsequently
    forced to have some sort of meaning by fooling around with backronym
    games. This particular acronym, STL, which refers to C++'s Standard
    Template Library, has a very specific and objective meaning. Therefore,
    there is absolutely no reason to try to make it some other thing it isn't,
    no matter how many people fall for the exact same mistake.


    Rui Maciel
     
    Rui Maciel, Feb 19, 2011
    #18
  19. ramtin

    James Kanze Guest

    On Feb 19, 12:17 am, Jorgen Grahn <> wrote:
    > On Fri, 2011-02-18, James Kanze wrote:
    > > On Feb 18, 9:52 pm, Rui Maciel <> wrote:
    > >> Pete Becker wrote:
    > >> > MiB is correct, but note that many people use "STL" to refer
    > >> > to the C++ STandard Library.


    > >> The C++ standard library encompasses a bit more components
    > >> than the STL[1]. If "many people" refer to the C++'s standard
    > >> library as "STL" then "many people" are making a mistake.


    > > The C++ standard library is largely a "template" library.


    > I think of it as three parts: the C library (which is a quite large
    > part!), the parts from (or compatible with) the original STL
    > (containers, iterators and algorithms), and some other stuff
    > (iostreams, locales, possibly std::string ...).


    > Personally, when I say STL (which is rarely) I mean the second part.
    > You'd never hear me claim std::printf is part of the STL.


    Good point. The T in STL means template, so STL really
    shouldn't refer to anything that isn't a template. For most
    people I talk to, STL doesn't include the C library, and it
    doesn't include some of the language support either (e.g. the
    operator new functions, or the standard exceptions). And for
    almost everyone, it does include the parts of Stepanov's library
    which were included in the standard. Where the meaning varies
    is whether additional templates in the standard library (e.g.
    std::basic_string, or the iostreams or the locale stuff) is part
    of STL or not, and for some people, whether parts of Stepanov's
    library that didn't make it into the standard (like slist), or
    templates which have since been added to Stepanov's library
    (like rope or hash_map) are part of the STL. Usage varies, so
    if you want to be precise, it's best to avoid the term.

    --
    James Kanze
     
    James Kanze, Feb 19, 2011
    #19
  20. ramtin

    James Kanze Guest

    On Feb 19, 1:02 pm, Rui Maciel <> wrote:
    > James Kanze wrote:
    > > Which is, or has been, the case. As Leigh says, language
    > > evolves, and today, the exact meaning of STL depends on who is
    > > talking---in other words, the acronym doesn't have an exact
    > > meaning.


    > The acronym doesn't have an exact meaning only to those who don't know
    > what the Standard Template Library is.


    The acronym doesn't have an exact meaning for those who wish to
    communicate precisely with other people.

    > > In many ways, Humpty Dumpty is right. "When I use a
    > > word, it means just what I choose it to mean." Of course, if I
    > > choose something very different from what other people
    > > understand, communication is rendered significantly more
    > > difficult, but in the end, each speaker chooses his or her
    > > vocabulary according to their personal beliefs. And when the
    > > personal beliefs of a majority of a liguistic group change, the
    > > generally accepted meaning changes.


    > If we look at this as a semantics issue then the only case that we can
    > make is that the meaning of an expression can change over time. This is
    > not the same as claiming that the meaning of an expression should change
    > over time.


    There's no should in it. There's nobody who is making immutable
    laws---even in French, the academie française can't stop the
    evolution of language. It's just a fact of life.

    > In this case, just because some people fail to know the
    > meaning of STL,


    They know their meaning, just as well as you know yours.

    > either due to confusion or because they simply never
    > learned what it meant,


    They might not have learned what it meant, but they know what it
    means. At least in the community they're communicating with.

    > it doesn't give them the right to perpetuate their
    > mistakes, particularly those based on ignorance that are subsequently
    > forced to have some sort of meaning by fooling around with backronym
    > games.


    There's no ignorance or mistake about it. No one is required to
    know the full etymology of a word in order to be able to use it.
    All they have to know is how the person they're communicating
    with will understand it.

    > This particular acronym, STL, which refers to C++'s Standard
    > Template Library, has a very specific and objective meaning.


    Which has changed over time. When I first heard it, it meant a
    library developed and maintained by Stepanov, including some
    things that aren't in the standard C++ library today. You're
    meaning doesn't correspond to the original use. (And wha do you
    mean by C++'s Standard Template Library? C++ has a standard
    library, much of which is implemented using templates, but
    there's no such thing as C++'s standard template library.)

    > Therefore, there is absolutely no reason to try to make it
    > some other thing it isn't, no matter how many people fall for
    > the exact same mistake.


    It's not a mistake for people to use a common vocabulary, as
    long as they understand one another.

    --
    James Kanze
     
    James Kanze, Feb 19, 2011
    #20
    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. Allan Bruce

    To STL or not to STL

    Allan Bruce, Oct 16, 2003, in forum: C++
    Replies:
    41
    Views:
    1,129
    Christopher Benson-Manica
    Oct 17, 2003
  2. Replies:
    4
    Views:
    832
    Daniel T.
    Feb 16, 2006
  3. Replies:
    2
    Views:
    575
    klaus hoffmann
    Feb 22, 2006
  4. Replies:
    5
    Views:
    539
    Markus Schoder
    Apr 16, 2006
  5. Steve
    Replies:
    2
    Views:
    541
    Andre Kostur
    Nov 6, 2007
Loading...

Share This Page