New features of C++11/14 -- template enhancement and variable templates
Template enhancement
1. External template
1) Problems of traditional C + +
In traditional C + +, templates are instantiated by the compiler only when used. In other words, as long as the fully defined template is encountered in the code compiled in each compilation unit (file), it will be instantiated. This results in an increase in compi ...
Posted by slick101 on Wed, 19 Jan 2022 06:59:05 +0100
C++11 lock usage (multithreading, concurrency, incorrect use, std::ref usage, RAII)
1, C + + multithreading
1.1 thread creation
Create other threads by creating objects of the STD:: thread class. Each STD:: thread object can be associated with a thread.
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <thread>
#include <iostream>
int k = 0;
void fun(void)
{
//Thread sle ...
Posted by PureEvil on Wed, 19 Jan 2022 03:16:32 +0100
Operating system course design - Windows process management
1, Experimental purpose (1) Learn to use VC to write basic Win32 console application (console application). (2) By creating processes, observing the programming and debugging operations of running processes and terminating processes, we can further get familiar with the process concept of the operating system and understand the "life" ...
Posted by hiberphoptik on Wed, 19 Jan 2022 02:33:24 +0100
Sword finger offer38: arrangement of strings
First, let's look back:
The code is as follows:
class Solution {
public:
vector<string> permutation(string s) {
vector<string> ans;
string str;
sort(s.begin(),s.end());
vector<int> visit(s.size(),0);
permutationCore(ans,str,s,0,visit);
return ans;
}
void permutat ...
Posted by pablodelapena on Wed, 19 Jan 2022 01:32:09 +0100
Data structure - sorting
Experimental preparation:
1. Understand and master the basic concepts and methods of direct insertion sort, half insertion sort, 2-way insertion sort, bubble sort and quick sort. 2. Master the basic idea of sorting algorithm.
1, Experimental purpose
Master the implementation of the basic idea of sorting algorithm.Through experiments, master ...
Posted by ted_chou12 on Tue, 18 Jan 2022 21:27:46 +0100
Python crawler is the most important and common library that must be mastered
The text and pictures of this article come from the network, only for learning and communication, and do not have any commercial purpose. If you have any questions, please contact us in time for handling.
Start body
Requests library is the most important and common library in Python crawlers. You must master it
Let's meet this library
R ...
Posted by Repgahroll on Tue, 18 Jan 2022 21:10:45 +0100
c + + basic STL Part 4 (queue container and list container)
A basic concept of queue container
Concept: queue is a first in first out (FIFO) data structure. The queue container allows elements to be inserted from one end and removed from the other end. explain:
Usually, the head of the queue is to remove data, and the tail of the queue is to insert data;There is no iterator operation in the queue, ...
Posted by afhouston on Tue, 18 Jan 2022 20:35:28 +0100
Detailed explanation of C++11 operator overloading and examples of vector class overloading (<<, >, +, -, * etc.)
1. Introduction to C + + operator overloading
The operands of predefined operators in C + + can only be basic data types. But in fact, similar operations are required for many user-defined types (such as classes). At this time, we must redefine these operators in C + + and give new functions to the existing operators, so that they can be used ...
Posted by ipwnzphp on Tue, 18 Jan 2022 19:17:35 +0100
Individual competition of the 9th "Turing Cup" NEUQ-ACM Programming Competition
A. Current situation at the end of University
Title Description
As a college student, it's time to check your final grade again. When your grade is greater than or equal to 60, please output "jige,haoye!", Otherwise, output "laoshi,caicai,laolao".
Enter Description:
One line, an integer x represents your score (0 < ...
Posted by lansing on Tue, 18 Jan 2022 18:58:17 +0100
Common [memory leak] posture
Focus on the official account [high-performance architecture exploration], dry cargo for the first time; Reply to [pdf] and get classic computer books for free
This article is excerpted from the article: Memory leaks - causes, avoidance, and location
This paper summarizes several common ways of memory leakage. Paying attention to these poin ...
Posted by jasonbullard on Tue, 18 Jan 2022 18:30:18 +0100