C++STL standard library learning note function object

catalogue preface: Text: 1. Function object 2. Function object class template in STL 3. Application of greater 4. Use custom large and small relationships in STL 5. Example: write MyMax template Postscript: preface: In this note, I annotated most of the code. Some of my ideas and comments were marked in blue, and the key points and ...

Added by Revan on Tue, 25 Jan 2022 06:45:53 +0200

2022GDUT winter vacation special Study-1 questions B, F, I and j

Topic links: Project Study 1 - Virtual Judge (vjudge.net) B - Full Permutation subject thought This problem can be solved by DFS, but when you see the full arrangement, you can immediately think of an STL function: next_permutation(x.begin(),x.end()) (header file #include). This function can give the next permutation of the current permutation ...

Added by danxavier on Sat, 22 Jan 2022 12:22:08 +0200

[C + +] STL Standard Template Library (Vector container - super detailed step-by-step example code explanation)

❥ it is mainly used for self review, plus experience exchange and sharing, one shift every day ❥ background ❀ a library is a collection of program components that can be reused in different programs. ANSI C + + includes a C++ STL (Standard Template Library), namely C + + Standard Template Library (c + + generic library). It defines commo ...

Added by bigMoosey on Wed, 19 Jan 2022 09:16:59 +0200

Container adapter -- queue, stack, priority_queue

What is an adapter adapters play the role of bearing and converter in the flexible combination and application function of STL components. The concept of adapter is actually a design pattern. In the design pattern, the definition of adapter style is as follows: convert one class interface into another class interface, so that classes that ...

Added by slyte33 on Sun, 16 Jan 2022 07:00:39 +0200

STL learning vector

STL learning chapter: vector - Introduction to vector vector is a serialization container with variable length The difference between vector and array: array is a static space, and vector can be expanded dynamically Dynamic expansion: instead of continuing the new space after the original space, find a larger memory space, and then copy the ...

Added by alapimba on Fri, 14 Jan 2022 23:52:52 +0200

[C++STL] Part 1: introduction and Simulation Implementation of string class

preface 1, string class in standard library 1.1 string class A class representing a sequence of charactersThe standard string class provides support for such objects. Its interface is similar to that of the standard character container, but it is specially used for operation Design features of single byte character strings.The string c ...

Added by pankirk on Fri, 14 Jan 2022 21:20:27 +0200

Implementation of C++vector simulation

I can accept failure, but I can't accept that I haven't struggled. 🎓 vector introduction vector is a sequence container that represents a dynamic array of transform sizes.Like arrays, vectors use continuous storage space to store elements. This means that you can use subscripts to access the elements of a vector, which is as efficient ...

Added by sidhumaharaj on Wed, 05 Jan 2022 14:10:41 +0200

C++ STL Standard Template Library

1. Basic concept of STL STL(Standard Template Library)STL is broadly divided into container, algorithm and iteratorContainers and algorithms are seamlessly connected through iteratorsAlmost all STL code uses template classes or template functions 2. Six STL components STL is generally divided into six components: container, algorithm, it ...

Added by Boo-urns on Wed, 22 Dec 2021 05:49:46 +0200

C + + Standard Template Library

Container class vector Take vector as an example vector <int> a = {1,2,3,4,5};//Put the array {1,2,3,4,5} into the container class instance vector <int> a = vector <int>(5); //Create a container class instance with 5 elements vector <vector<int>> a = vector <vector<int>>(5);//Create a container c ...

Added by blufish on Mon, 20 Dec 2021 23:34:40 +0200

[C + + from bronze to king] Part 20: a preliminary understanding of set, map, multiset and multimap of STL

Catalogue of series articles preface 1, Associative container In the initial stage, we have touched some containers in STL, such as vector, list, deque and forward_list(C++11), etc. these containers are collectively referred to as sequential containers, because their bottom layer is a linear sequence data structure, in which th ...

Added by Rigo on Sun, 19 Dec 2021 20:57:39 +0200