C++: Templates (function templates, class templates)

This article mainly introduces generic programming, function templates and class templates. Table of Contents 1. Generic programming 2. Function template 1. Function template concept 2. Function template format 3. Principle of function template 4. Instantiation of function templates 5. Matching principles of template parameters 3. Class template 1. Definition format of class template 2. Instantiation […]

Solve TSP problem based on particle swarm algorithm in C++

Particle swarm optimization algorithm solves TSP traveling salesman problem C++ (2020.11.12)_jing_zhong’s blog-CSDN blog Hybrid Particle Swarm Optimization (PSO): C++ implements TSP problem – Zhihu (zhihu.com) 1. Principle It is another guessing algorithm. It is similar to the genetic algorithm. It also sets the number of iterations, controls when it will end, and then sets the […]

The whole process of printing and compiling C++ (214)

Introduction: CSDN blog expert, focusing on Android/Linux System, share multi-mic voice solutions, audio and video, codec and other technologies, and grow with everyone! Quality Column:Audio Engineer Advanced Series[Original information is being updated continuously… ] Life motto: There are never shortcuts in life, only actions It is the only cure for fear and laziness. For more […]

[C++] Polymorphism “Li Liyuan Shang spectrum”

Table of Contents 1. Concept 2. Definition 2. Virtual function rewriting (overwriting) 3 special cases of virtual functions 1. virtual keyword 2. Override the destructor 3. Covariance 3.Interview questions 4. The difference between interface inheritance and implementation inheritance 5. C++11 override & final 1. final: Modify the virtual function to indicate that the virtual function […]

Caused by gcc/c++ version inconsistency problem

1. Question The system of the rk3566 board is ubuntu20.04 focal, and /etc/apt/source.list is replaced by Alibaba source. The x86-67 PC host system is ubuntu20.04 jammy /etc/apt/source.list replaced by Tsinghua source Follow rknpu2’s development tutorial Rockchip_Quick_Start_RKNN_SDK_V1.5.2_CN.pdf: After the cross-compilation is passed (cross-compilation issues are recorded in this document: CSDN), push the relevant generated files to […]

Summary of C++ map access elements empty, size, max_size, operator[], at, insert, erase, swap, clear, emplace, emplace_hint (206)

Introduction: CSDN blog expert, focusing on Android/Linux System, share multi-mic voice solutions, audio and video, codec and other technologies, and grow with everyone! Quality Column:Audio Engineer Advanced Series[Original information is being updated continuously… ] Life motto: There are never shortcuts in life, only actions It is the only cure for fear and laziness. For more […]

Summary of C++ ostream flow functions good, eof, fail, bad, operator!, operator bool, rdstate, setstate, clear, copyfmt (209)

Introduction: CSDN blog expert, focusing on Android/Linux System, share multi-mic voice solutions, audio and video, codec and other technologies, and grow with everyone! Quality Column:Audio Engineer Advanced Series[Original information is being updated continuously… ] Life motto: There are never shortcuts in life, only actions It is the only cure for fear and laziness. For more […]

Compile the C++ version jsoncpp/opencv/onnxruntime on ubuntu18.04 and how to configure CMakelist to use them~

The background of this article is the author’s notes on compiling C++ code on ubuntu, relying on some packages, and then needing to compile and configure it to CMakelist. The main reason is that I don’t understand CMakellist very well. I made a note to prevent forgetting. It also provides readers with a one-stop reference. […]

How to use and configure Basler industrial cameras for machine vision (C++)

Basler industrial cameras are used for binocular vision. Many problems arise and are recorded: First, read more manuals: https://zh.docs.baslerweb.com/software There are all source codes and reference examples in the manual. In fact, during use, most of them are these source codes. Select the corresponding example code for specific projects. 1. Camera and lens selection You […]