STL [algorithm] | large collection of common algorithms

1, Introduction STL algorithms are designed to handle one or more iterator intervals; In most cases, you only need to provide a starting point; STL algorithm adopts coverage mode instead of placement mode; 1.1 category 1.1.1 _if end When this kind of algorithm has two forms and the number of parameters is the same, the first f ...

Added by mwichmann4 on Tue, 08 Mar 2022 10:29:16 +0200

vector container of C + + high-order STL

The vector container is the best alternative to arrays vector container can also be used to save and manage a large amount of data of the same type, but it is superior to array in terms of memory management and access to data elements: The dynamic increase or decrease of the capacity of the vector container replaces the fixed capacity of the a ...

Added by lordfrikk on Fri, 04 Mar 2022 13:02:24 +0200

STL set container multiset container

Containers in STL: set container common interfaces and usage of multiset container: set / multiset container: also known as a set, all elements are automatically sorted when inserted (from small to large, i.e. ascending) Bottom structure of set / multiset container: these two containers belong to associative containers, and the bottom stru ...

Added by anindya23 on Fri, 04 Mar 2022 11:02:06 +0200

Use of C++ STL list

C++ list usage   general Defined in the header file < list >, std::list is a container that supports constant time to insert and remove elements from any location of the container. Fast random access is not supported. It is usually implemented as a two-way linked list. With STD:: forward_ Compared with list, this container prov ...

Added by J4rod on Tue, 08 Feb 2022 07:00:24 +0200

Memory configuration and release of space Configurator

catalogue I Configurator for SGI II First level configurator (malloc_alloc) III Secondary Configurator 3.1 notes 3.2 space configurator allocate() 3.3 refill(size_t n) 3.4 encapsulate the first and second level configurators I Configurator for SGI SGI designed a two-level configurator: 1 When the configuration block exceeds 128 byte ...

Added by frkmilla on Sun, 06 Feb 2022 20:29:14 +0200

[C + +] vector of STL container

preface C + + introduces the idea of object-oriented. Compared with C language, a class can better manage and operate some data structures. In C language, we use fixed length array and dynamic array from malloc to maintain a continuous set of data of the same type In C + +, based on the idea of object-oriented, the class used to manage spati ...

Added by fangfang on Fri, 04 Feb 2022 02:25:47 +0200

STL database review

Happy New Year! The first blog in 2022 is mainly because I don't like summarizing, so I need to read more and summarize more. Then it's today's review! 1.vector vector<int>a; a.push_back(); a.pop_back(); a.insert(a.begin() + i, k);//Insert from position i for (vector<int>::iterator i = a.begin(); i != a.end(); i++) { cout ...

Added by binujayaraj on Thu, 03 Feb 2022 05:52:23 +0200

C + + -- function object

Many STL algorithms use function objects - also known as function symbols. A function character is any object that can be used in conjunction with () in a functional manner. Including function name, function pointer and class object of overload (). For example, such a class is the function symbol class A { private: int a; public: A(in ...

Added by marconi8 on Wed, 02 Feb 2022 19:14:37 +0200

shared_ptr and weak_ptr

shared_ptr Reference from https://www.jianshu.com/p/b6ac02d406a0 shared_ The PTR class does almost nothing. It inherits__ shared_ptr, __shared_ptr has a type of__ shared_ Member of type count_ M_refcount, __shared_count has an internal type of_ Sp_counted_base *_ M_ Members of PI_ Sp_counted_base is the whole shared_ The core of PTR functi ...

Added by minou on Mon, 31 Jan 2022 05:14:05 +0200

Vector C + + language implementation of basic data structure and algorithm

0 - General The code is based on data structure C + + language version by Mr. Deng Junhui, with appropriate changes. It feels like this is basically a simplified STL. Follow the book and review the basics of C + + language. 1 - interface declaration The vector class is implemented here. In order to distinguish it from the vector in the stand ...

Added by glcarlstrom on Wed, 26 Jan 2022 11:27:49 +0200