C ++ STL study Note 1

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.