Statement: Source code and "STL Source Analysis" (Houtie)Stl:C + + Standard Template Library, high versatility.Common data structures are encapsulated.Provides common general-purpose algorithms.STL six major components:Container algorithm iterator Faux function (function object) Adapter ConfiguratorThe role of the Space Configurator:1. Improve the code reuse rate, the function of modularization.2. Reduce memory fragmentation issues.For example, we lis
Using the STL Library has always been to value_type this thing is not very good understanding, it can be said that is not understood. Today saw the "STL source analysis" before it dawned. Here's a little record.
Each STL class has value_type this kind of thing, the popular saying Value_type is the STL container attire
Map is an associative container of STL, it provides one-to-one (where the first one can be called a keyword, each keyword can only appear once in a map, the second may be called the value of that keyword), and because of this feature it is possible that when we are dealing with one-to-one data, Provides fast access to programming. Here's the organization of the map's internal data, within the map, a red and black tree is built (a balanced binary tree
SGI-- Silicon Graphics [Computer System] Inc. Silicon graph [Computer System] Company.
STL-- Standard Template Library: Standard Template Library.
Container Concept
The STL container is to implement the most commonly used data structures.
A container is a collection of specific types of objects. According to the characteristics of data arrangement in containers, containers can be divided into two types: s
# Estl 50th: familiar with STL-related web sites. Three: www.sgi.com/tech/stlw.www.stlport.org and www.boost.org.
# 49th pieces of estl: Learn to analyze compiler diagnostic information related to STL. Well, the first step is to replace the big method, and then introduce the container, insert iterator, binder, output iterator or
Algorithm What are the common mistakes.
# Estl 48th: always contains (# includ
In the C ++ language, there are some elements such as arrays, strings, streams, and bitsets that are not part of the standard STL, but are related to STL to some extent. The following is a brief introduction.
Array as STL container
We know that "dumb" pointers can be good as iterators because they support the required operators. This is not a trivial matter.
STL Source code Analysis-iterator and traits programming methodThe central idea of STL is to separate the algorithms from the containers, design them independently, and finally glue them together, and the generics of the algorithms and containers are not very difficult, C + + class templates and function templates can achieve the goal, but sticking together is the thing of the iterator.So the iterator is to
MFC ATL STL
Mfc atl stl classification: solves the problem
MFC ----- Application FrameworkATL ----- powerful tool for writing comSTL ----- used to write the logical part
MFC: the goal of MFC is desktop applications. Of course there are some network components, but they are not adequate. MFC is a set of App Wizard. In this regard, it has been very successful, but now the network is becoming more and more
I have read the source code of the STL space configurator and summarized it as follows:1. STL space configurator: It mainly consists of three file implementations. stl_construct.h defines the global functions construct () and destroy (), which are responsible for Object Construction and Analysis. The stl_alloc.h file defines level 1 and level 2 provisors. The provisioner name is alloc. stl_uninitialized.h d
STL Practice Guide Practical Guide to STLAuthor: Jeff boganTranslation: Zhou Xiang
(Part 2)
Cursor (iterator)
I have said that a cursor is a pointer, but not just a pointer. A cursor is similar to a pointer, and its function is similar to a pointer. However, a cursor returns a value from the center of the container by reloading the "*" and "->" of a dollar. It is not a good idea to store these values in the container, because these values will become
To learn STL, it is necessary to use the adapter and some common algorithms. They are all important components of the STL.Adapter
In the STL, adapters can be fitted with some containers. For example, the stack and queue are deque by a double-ended queue. In fact, the adapter is also a design pattern , which is to convert the interface of a class into another interface that the user wants. Simply put:
0 Why do I need hash_mapDid you use map? Map provides a very common feature, which is to provide key-value storage and lookup capabilities. For example, I want to record a person name and the corresponding storage, and add at any time, to quickly find and modify:Yeu Bu-The head of Huashan faction, called the Gentleman Sword Zhang Sanfeng-Wudang head, Taijiquan founder Oriental undefeated-first master, sunflower treasure ...This information is not complicated if it is saved, but it is more troubl
STL String class What's wrong? ChenhaoObjectiveLast weekend, when I was chatting with my classmates about the fragrant hills, the classmate said that the string class in the STL had tortured him before he developed a system a few years ago, and then, as the complexity of the program deepened, he almost lost confidence and trust in the string class. He felt he was confused to string class. To be honest, I ha
Introduction
People often say, do not rebuild from the wheel, to stand on the shoulders of giants. In the face of these STL components that play the role of the wheel, is it necessary to delve into the design principles or implementation details? The answer varies from person to person. From an application perspective, you do not need to explore the implementation details (however, to a considerable extent, understand the underlying implementation of
Summary
This article mainly by the C + + Standard Template Library STL implementation of the data structure of the study and use to deepen the understanding of the data structure, that is, the relationship between the theoretical analysis of data structure and specific application implementation (STL), this article is the second series of summary, mainly for the linear table of the linked list
use of C + + STL basic containersCategory: C/c++/vc2014-04-09 21:01 583 People read comments (0) favorite reports StllistmapdequesetThere are two types of containers in C + +: Sequential containers and associative containers. The sequential containers are mainly vector, list, deque and so on. Where vectors represent a contiguous memory, based on an array implementation, List represents noncontiguous memory, is based on a linked list, deque is simi
A doubly linked list is a common data structure. It's not complicated, and it's not too difficult if we're going to make it ourselves. But since the STL has provided us with one, it may be used directly. To do so, not only saves time and effort, but also the reusability of code. Header files and template classes To use a doubly linked list provided by STL, you need to include a header file #include This a
Algorithms that use the C + + standard library include header files The STL algorithm is used to process one or more iterator intervals, and the first interval is usually expressed as a starting point and an end point, while the other intervals simply provide a starting point, and the end point can be deduced based on the number of elements in the first interval. The caller is required to guarantee the validity of the interval. When the
Topic linksIdea: STL Dafa Good to remove the end of the character 0, and then compare the size of the string, while using the automatic map of the name in accordance with the dictionary output, >>>stl Dafa good#include #include#include#include#include#includeSet>#includeusing namespacestd;Const intn=2e5+Ten; Mapstring,int>A;mapstring,string>b;structnode{stringb;} C[i]; voidSolvestringS1) { intlen1=s1.siz
occurrence of a sub-rangeFind_end search for the last occurrence of a sub-rangeFind_first_of search for the first element equal to one of the valuesAdjacent_find search for two consecutive equal elementsEqual determine if two intervals are equalMismatch judge whether two intervals are equalLexicographical_compare is less than another sequenceComparison of string search function and STL search algorithmSearching for a string function
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.