Why study STL:
Data Structure andAlgorithmIt is the core of programming. STL contains a variety of data structures and excellent algorithms. It is really worth studying in depth. Although this article focuses on usage, I hope you can have a look at the implementation of relevant data structures, it can be of great help to C ++.
The STL library has multiple versions. I use SGI. For the compilation and installation methods, see the following link:
Http://blog.csdn.net/hong201/archive/2009/07/06/4322975.aspx
PS: According to the installation method of Meng Yan on the internet, I encountered some problems.ArticleThe installation is successful.
I have no deep feelings about why the SGI version STL library is used. The online saying is:
1. Open Source
2. High readability
3. self-built containers, such as slist and hash_set
Let's talk about my feelings: when using the set container in the VC library, I found that the Set element can be changed through the iterator, which will destroy the red/black tree, but the compilation is successful, this is a serious bug.
We recommend that you install the STL library of SGI.
In my notes, I mainly introduce the usage of various containers and use vc6.0 as a tool. Many people are struggling with how to use containers for custom data. I try to write some examples.
Because it is new to C ++, there will inevitably be errors in this article. I hope you will criticize and correct them.