[take you through C + +] operator overloading (assignment operator overloading) turns out to be such a thing

Operator overloading In order to enhance the readability of the code, C + + introduces operator overloading. Operator overloading is a function with a special function name. Its purpose is to make user-defined types operate directly with operators like built-in types. Operator overloading is to give multiple meanings to existing operators ...

Posted by Jeyush on Sat, 08 Jan 2022 12:02:09 +0100

Use of decltype keyword of new features of C++11

I decltype keyword introduction Decltype keyword is similar to auto keyword, but there are differences; The auto keyword determines the type represented by auto through the initialized variables at compile time. In other words, the expression modified by auto must be an initialized variable; So what if we just want to get the type of this vari ...

Posted by timelf123 on Sat, 08 Jan 2022 11:11:31 +0100

Inheritance in C + +

Inheritance in C + + One of the most important concepts in object-oriented programming is inheritance. Inheritance allows us to define a class based on another class, which makes it easier to create and maintain an application. This also achieves the effect of reusing code functions and improving execution efficiency. When creating a class, ...

Posted by the_ut_tick on Sat, 08 Jan 2022 11:01:51 +0100

c language_ Array (super detailed analysis, easy to master)

Catalogue 1. Creation and initialization of array 1.1 creation of array 1.2 initialization of array 1.2.1 initialization of one-dimensional array 1.2.1 initialization of two-dimensional array 2. Some usage methods of array 2.1 calculating array size 2.2 output all contents of the array 3. Storage of array in memory 4. Array out of bou ...

Posted by JesperBisgaard on Sat, 08 Jan 2022 10:41:10 +0100

Ski Valley P2573 minimum spanning tree

Title Description a180285 likes skiing very much. He came to a snow mountain, where there are , mm , taxiing tracks and , nn , track intersections (also scenic spots), and each scenic spot has a number , i\space (1 \le i \le n)i (1 ≤ i ≤ n) and a height , h_ihi​. A180285 can slide from the scenic spot ^ ii ^ to the scenic spot ...

Posted by SheDesigns on Sat, 08 Jan 2022 07:58:45 +0100

C++ Primer 0x07 exercise solution

📔 C++ Primer 0x07 exercise solution Better reading experience 7.1 defining abstract data types 7.1.1 defining abstract data types 7.1 use the sales defined in section 2.6.1_ The data class writes a new version of the transaction handler in section 1.6. #include <iostream> #include <string> struct Sales_data { std::stri ...

Posted by thesaleboat on Sat, 08 Jan 2022 07:09:28 +0100

[learning log] monotone stack monotone queue

Monotone stack Monotone stack is actually to maintain that the sequence in the stack is monotonous. When the element pressed into the monotone stack will break the monotonicity, the element inside will pop up until the monotonicity can be satisfied when the element is pressed into the stack. vector<int>v; stack<int>s; for (int i = ...

Posted by mikejs on Sat, 08 Jan 2022 03:42:23 +0100

Detailed C + + implementation of depth first search

DFS The full text is about 4000 words. If you start learning DFS, I believe it will be of great help to you. Your ability is limited. Many terms are not professional enough. Long live your understanding Depth first search of binary tree The concept of binary tree will not be discussed in detail here The array is used to store the binary tre ...

Posted by bibie on Fri, 07 Jan 2022 21:59:47 +0100

C + + generic algorithm

generic algorithm Generic algorithms are some algorithms defined in STL library. These algorithms can operate various data types with one interface, so they become generic algorithms. Most algorithms are defined in the header files algorithm and numeric. It means that various types of algorithms can be operated with one interface, which is a g ...

Posted by nawhaley2265 on Fri, 07 Jan 2022 10:36:11 +0100

Level dB MemDB source code analysis

prefaceRecently, I was studying and learning the source code of leveldb and tried to rewrite leveldb RS with Rust. The memdb module in leveldb uses skiplist as a kv memory storage. The implementation of the relevant code is very beautiful, so I have this article. Leveldb implements skiplist by using Arena mode. In short, it uses linear arrays t ...

Posted by rajavel on Fri, 07 Jan 2022 10:02:03 +0100