First knowledge of STL

Source: Internet
Author: User

Basic Concepts >>

The STL (Standard Template Library) is the most important part of the C + + standard library, and STL is not only a reusable component library, but also a software framework that encompasses both algorithms and data structures.

Version Introduction >>

The original version of-alexander Stepanov, Meng Lee completed the original version in HP Labs, and in the spirit of open source, they declared that they allowed anyone to use, copy, modify, distribute, and trade the code without charge. The only condition is that you also need to make an open source declaration like the original version.

1. HP version-also the ancestor of all STL

2. PJ version-developed by P.j.plauger--windows-vs

3. RW version-developed by Rouge Wave Inc.

4. SGI version-Silicon Graphics Systems, Inc. development-linux

As I study the main reference is Houtie Teacher's "STL Source Analysis" a book, so Bo main focus on SGI version, GCC is also this version ~

STL six major Components >>

1. container (containers)-a variety of data structures, such as vectors, lists, deque, set, map, etc.

2. algorithm (algorithm)--a variety of common algorithms, such as sort, search, erase and so on.

3. iterators (iterators)-acts as a binder between the container and the algorithm.

4. functor (functors)-behaves like a function, which can be used as a strategy of the algorithm.

5. Adapter (adapters)--something that modifies the container or the interface of an imitation function or iterator.

6. Configurator (allocators)--Responsible for space configuration and management.

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/84/30/wKioL1eIQ1ODfJjUAAGEnDW4kvA783.png "Title=" captures a. PNG "alt=" Wkiol1eiq1odfjjuaagendw4kva783.png "/>


From the above picture, we can see that the relationship between the six components is as follows: The container from the Configurator to obtain the corresponding data storage space, the algorithm through the iterator access to the contents of the container, the functor can assist the algorithm to achieve different policy changes, the adapter can be modified or socket functor.


This article is from the "July boreas" blog, please be sure to keep this source http://luminous.blog.51cto.com/10797288/1826664

First knowledge of STL

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.