Objective
This article is the author's own use of the STL after some of the views, for want to rely on this article to learn STL, is impossible. Recommend some of the books introduced later.
The concept of STL
In STL, it is divided into three main functions. Collect class, (e.g. vector, list, ...), algorithmic parts
Problem:
I read about STL in several different places, but I still don't know if I am using STL or MFC in my application. My program also deals with string,vectors and other things. What's the difference between using STL and MFC?
Answer:
To answer, "which one should I use?" "The answer to this question is almost the same. It depends on what you want to do, th
inside of the queue some of the implementation and method definition.I am looking at Houtie STL source parsing, the inside said that in fact, the method of the queue is simple, list some of the interface to the closure, you can easily implement the queue. Specific use list of the implementation of the code, you can see the "STL Source Analysis" this book./* Queu
element (does not return it)
C. Erase (POS)
Removes the element at iterator positionPosAnd returns the position of the next element
C. Erase (beg, end)
Removes all elements of the range[Beg, end) And returns the position of the next element
C. Resize (Num)
Changes the number of elementsNum(IfSize ()Grows, new elements are created by their default constructor)
C. Resize (Num, ELEM)
Changes the number of elements to num (ifSize ()Grows, new elem
It took me one night to translate an article about STL.Article. The first time I translated this kind of things, I felt that computer books are still better at the original English version, because many concepts cannot be properly expressed in Chinese (it's just that they can't be said ,:-)). Thanks to the first translation, the level must be relatively good. The key is that STL has never been seen before and is unfamiliar, so it is very hard to trans
1. STL Basic IntroductionThe C + + STL (Standard Template Library) is a set of powerful C + + template classes, collectively known as a series of software developed by HP Labs. The purpose of the STL is to standardize the components so that they do not have to be re-developed so that the latter can use the ready-made components, and the open source components are
Before watching "C + + Primier", also solved in the sequential window Insert/erase will be involved in the problem of iterator failure, and did not delve into. I ran into this problem when I wrote the program today.
1 The inexplicable erase
Originally my program is purple, don't talk, I know this is a problem, but this is the most intuitive idea
Vector
Yes, the program crashes. After the iterator it was removed, the IT iterator was invalidated and no more ++it operations were possible.
Howe
have been learning sorting algorithms, have not been in the list of lists too much effort, because not much. Recently see STL Source code, only to find that the original even the list, can also have time complexity for O (NLOGN) algorithm,Much to my surprise, I can usually think of an insertion sort.The following code is written according to the source (remove the template to increase readability), note that forward_list is the c++11 new one-way list,
+ + Primier", found that the standard writing on this book is this:
int arr[]={0,1,2,3,4,5,6,7,8,9,10};
Vector
Run a bit, that's right. I printed the debug information and found that, as before, erase the results to the members of the It,it _ptr did not change. The only possibility is that there are other flags in the iterator and the iterator is "invalidated" if the current element is deleted. The C + + Primier does not explain this mu
this and targets programmers coming FR Om languages like Java.It presents ~50 easy-to-remember rules of thumb along with their rationale in a very accessible (and enjoyable) style. [Review]
effective STL (Scott Meyers) This is the same to the part of the coming from the STL what effective C + + did to the LANguage as a whole:it presents rules of thumb along with their rationale. [Review]
In
1th: Carefully select the type of container.
Standard STL sequence Containers: Vector, String, deque, and list.
Standard STL Associative containers: Set, Multiset, map, and Multimap.
Non-standard sequence containers slist and rope. Slist is a one-way list, rope is essentially a "heavy" string.
Non-standard associative containers hash_set, Hase_multiset, Hash_map and Hash_multimap.
Vector as a substitute fo
actual operation and special knowledge (multithreading, mutual exclusion, network communication, graphical interface, etc.). But in order to let learners have certain engineering ability, this book specially supporting VC basic use, debugging method, standard C function usage, Standard Template Library (STL) usage.
And then again, the body part. The text is a total of 27 chapters, covering all the syntax
also considered in the specific chapter arrangement, for readers who only need C, only the first 18 chapters (except for the 14th chapter), and the Appendix "C + + and C language differences" are required.On the other hand, why is it called a "learning guide" rather than a "Programming Guide"? This is because of this grammar tutorial, the emphasis is on explaining grammar. While programming is a larger concept, not only to understand the grammar, but also to understand the actual operation and
When I asked some friends from the same company about the serverProgramWhen using STL in, they all answered in their own company's server program development, generally not using STL.Why is the standard library unpopular in the server program development environment? I think STL has three major problems in a highly stable, high-performance, and high-concurrency environment like server programs.
Question 1:
The short description of the STL (Standard Template Library) is not enough to reflect its design prowess, and the following text is merely an "appetizer" that encourages you to delve into the STL.
STL is not only a library, it is an excellent idea as well as a set of conventions. STL contains three main components: co
Introduction: This article describes the methods of exporting STL classes and classes containing STL in DLLs. Example source code
DLLs cannot directly export generic templates (generalized template), so if you are exporting an STL class, the template must be instantiated (instantiated) first. In addition, if the exported STL
ZC: Here in the video there is a debugging tips, vs08/vs2010 start, the console program will automatically exit (unlike VC6), then you can set a breakpoint on the last sentence of the function exit, and then view the information printed by the console.ZC: This tells me that the good thing about using string is that the index is out of bounds when the string is manipulated (such as copy/delete operations)"01:05", the main points of this lecture are as follows:One, what things
Previously did not pay attention to the sorting algorithm, because there are very few application scenarios, the recent interview process found that the sorting algorithm is often asked, sometimes in some written or interview topics need to use the sorting algorithm to solve the problem, if each of their own handwritten sort, then it is quite time-consuming, And I don't necessarily write out the wrong sort algorithm in a short time, this time STL prov
Author: the robe of anger
1. Introduction to STLSTL (Standard Template Library) is a collection of software developed by the HP lab. It was developed by Alexander Stepanov, Meng Lee, and David R musser while working at the HP lab. Although it mainly appears in C ++, this technology has existed for a long time before it was introduced into C ++.In a broad sense, STL code is divided into three types: algorithm (algorithm), container (container), and ite
By posting articles on the STL Chinese site, I feel that I cannot find the address when I want to refer to it and simply post it to my blog.STL sorting (SORT)
Author winter
STL sorting (SORT)
Why do you have to master STL?
1. Sort Algorithm provided by STL
1.1 Introduction to all sort Algorithms
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.