im having a hard time understanding what exactly the stl list is doing?
Anyone know of a good site on stl or a book perhaps?
im having a hard time understanding what exactly the stl list is doing?
Anyone know of a good site on stl or a book perhaps?
I can search on google myself, I asked so that someone could send me to a good site that helped them, and not just another one that shows how to sitck a bunch of integers in a list.
IMO, the best way to learn about how a linked list works is to program a simple linked list class of your own... it helped me greatly!
Here's the tutorial I used to make my first linked list class
And here's the tutorial which I feel much better
>im having a hard time understanding what exactly the stl list is doing?
It was designed that way, you don't need to know how std::list works, just how to use it. If it is linked lists that you are interesting in, there are oodles of resources at your local bookstore or online. Try www.accu.com for good book reviews.
-Prelude
My best code is written with the delete key.
I have coded plenty of linked lists, but im told that stl would probably be more efficient that what I would write.
probalby true. In essence the STL linked list class is built on a templated doubly linked list with a multitude of methods to manipulate values in the list. It's neat in that you only have to provide the class to act as the "node" in the list. The class does not need to contain pointer(s) to self like in lists you are used to writing yourself, the compiler provides all that "extra" stuff; you just provide the class data members. Learning about the class methods is reasonably straightforward as each method is reasonably intuitively named and many of the STL container classes use similar methods, so know one classes methods, know them all (well, almost). Of course feeling pretty comfortable with iterators is also helpful, but again the concept of iterators goes throughout STL so once you learn it the knowledge transfers pretty readily to other container classes, etc.