C++C++11C++14C++17C++20Learn C++Syntax

How To Use Lambda Expression With std::thread In C++?

Lambda Expressions allow users to write an inline expression that can be used for short snippets of code that are not going to be reused and don’t require naming in your C++ app. The lambda expressions construct is introduced in C++ 11 and further developed in the C++17 and C++20 standards. In modern C++ development, they are very useful and can be used with std::thread in multi-thread…
Read more
C++C++11C++14C++17C++20IteratorsLearn C++Syntax

How To Use Functor Object With std::thread In C++?

In modern C++ development we can use multi-thread operations and parallel programming features in our applications in different ways of modern programming features. The std::thread class is a special class defined in <thread> header in the concurrency support library that comes with C++11. We can use the std::thread class in multi-thread operations with functor objects, and in this post…
Read more
C++C++11C++14C++17C++20IteratorsLearn C++Syntax

What Is A Mutex Mutual Exclusion In Modern C++

CPUs and GPUs have evolved year on year to feature a greater number of cores and transistors to give more computational power for today’s servers and computers. With the advent of multiple cores, it is common now for programs to make use of multiple simultaneous threads. In modern C++, multi-thread operations are amazingly evolved since C++11, still there are new improvements in the latest…
Read more
C++C++11Learn C++

Learn How To Eliminate Unnecessary Copying In C++

In modern C++, rvalue references are a compound type like standard C++ references, which are referred to as lvalue references.New rvalue reference rules were set by the C++11 specifications. In many cases, data is copied that simply needs to be moved, that is, the original data holder need not retain the data. The rvalue reference can be used to distinguish cases that require copying versus…
Read more