Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand STL

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about how to understand STL. Many people may not know much about it. In order to let you know more, Xiaobian summarizes the following contents for you. I hope you can gain something according to this article.

STL

  STL is the abbreviation of Standard Template Library, Chinese name Standard Template Library, a series of software developed by HP Laboratory. It was developed by Alexander Stepanov, Meng Lee and David R Musser while working at HP Labs.

 Basically, STL is a collection of "containers" such as list,vector,set,map, etc. STL is also a collection of algorithms and other components. The term "container" and collection of algorithms here refers to the masterpieces of many of the world's brightest minds over many years. The purpose of STL is to standardize components so that off-the-shelf components can be used without re-development. STL is now part of C++, so no additional library files are installed.

STL components

containers

iterators

Space allocator

Adapters

algorithms

Functions (functions)

Container classification

sequential container

array (array);

vector: consecutively stored elements;

list: a doubly linked list of nodes;

deque: An array of pointers to different elements stored consecutively.

Adapters (new containers implemented with sequence containers that provide different functionality on top of generic sequence containers)

stack;

queue;

priority_queue: A queue in which the order of elements is determined by some predicate acting on stored pairs of values.

associated container

set: a red-black tree of nodes, no two different elements having the same order;

multiset: A set that allows two elements to exist in equal order;

map: a set of {key, value} pairs;

multimap: A mapping that allows key pairs to be mapped in equal order.

iterator

 Almost all algorithms offered by STL work by accessing sequences of elements through iterators, and each container defines its own iterator for accessing elements in the container.

After reading the above, do you have any further understanding of how to understand STL? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report