Explain the smart pointer in C + +

preface Four smart pointers in C + +: auto_ptr, unique_ptr,shared_ptr, weak_ptr, of which the last three are supported by C++11, and the first has been abandoned by C++11. Introduction to C++11 intelligent pointer Smart pointer is mainly used to manage the memory allocated on the heap. It encapsulates the ordinary pointer as a stack object. ...

Posted by kabucek1 on Mon, 23 May 2022 07:09:43 +0300

SSL_1491 [Angel's Oath] (High Precision Subtraction)

Angel's oath topic TENSHI was very lucky to be chosen as the angel holding the key of wisdom. She must, like other newly elected angels, take an oath before taking office. The swearing ceremony is that each angel expresses his own mission, and their speeches are placed in N treasure boxes arranged in a circle. The boxes are numbered 1, 2, 3..., ...

Posted by telvitajoel on Mon, 23 May 2022 00:40:30 +0300

Da Xiong's static study notes

Written in front, This is the note I wrote after reading other people's articles, which is almost the same as the original text. In the future, I will also add the relevant things I learned in other places, that is to say, this is just my own note. Original link: https://github.com/Light-City/CPlusPlusThings/tree/master/basic_content/static Whe ...

Posted by cscheuble on Sun, 22 May 2022 16:38:40 +0300

A simplified daemon framework written by X macro

Project introduction This is a daemon framework under Linux For the purpose of project optimization and learning to master and use X Macro skills, this project skillfully uses X Macro to write a daemon management framework that can expand the number of processes arbitrarily and pass parameters. This code is extremely concise and easy to use. If ...

Posted by LukeO on Sun, 22 May 2022 04:59:18 +0300

A brief talk on irrotational Treap (based on the balanced tree of literature and art of Luogu P3391)

Let's talk about it. It's really shallow. It's completely based on the following inscription ↓ Luogu P3391 Look at the questions myself. I'm too lazy to stick... analysis In fact, there is nothing to analyze. This is a template problem of Splay tree, which solves the interval maintenance problem that can not be solved by general Treap. ...

Posted by springo on Sun, 22 May 2022 00:51:18 +0300

Advanced Google test - parameter test, Mock test, time-consuming test, type test

1. Previously on Google test is a unit testing framework developed for C + +. It provides many favorable wheels for writing unit testing, which can largely avoid the trouble of repeatedly building wheels for writing unit testing. This series of articles is preceded by a basic document for getting started. It mainly focuses on the environment ...

Posted by shrimp on Sat, 21 May 2022 04:34:32 +0300

Smart pointer [C + +]

Smart pointer [C + +] RALL mechanism: resource acquisition is initialization, and the technology of using = = local object = = to manage resources (resources here mainly refer to the limited resources in the operating system, such as memory, network socket, mutex, file handle, etc. local object refers to the object stored in the stack, and its ...

Posted by TravisJRyan on Sat, 21 May 2022 03:06:40 +0300

Real liar and search Collection + dp + backtracking

There are two kinds of inhabitants on an island, one is God and the other is devil. Gods will never tell lies, and demons will never tell the truth. Each member on the island has an integer number (similar to the ID number to distinguish each member). Now you have nn opportunities to ask questions, but the content of the question can only be ...

Posted by jOE :D on Fri, 20 May 2022 23:35:55 +0300

Digital statistics DP (338. Counting problem)

Digital statistics DP (338. Counting problem) Given two integers ∼ a ∼ and ∼ b, find the number of occurrences of 0 ∼ 9 in all numbers between ∼ a ∼ and ∼ b. For example, if a=1024 and b=1032, the total number of , 9 , between , a , and , b , is as follows: 1024 1025 1026 1027 1028 1029 1030 1031 1032 Among ...

Posted by artisticre on Fri, 20 May 2022 22:49:00 +0300

27 second order structural model

Note: the content in the blog is mainly from "Ditai Software College", and the blog is only used for private notes. Test environment: Ubuntu 10.10 GCC version: 9.2.0   1, Review of constructors 1) About constructors - class constructor for object initialization - the constructor has the same name as the class and has no return ...

Posted by Impact on Fri, 20 May 2022 15:42:52 +0300