C++C++11C++14C++17Learn C++

What Is A Function Object Functor In C++?

In modern C++ programming we can use many different ways to call functions. One of the features from C11 is functor, an early function object in C++. The functor function objects are callable objects. A functor or function object is any object for which the function call operator is defined. Let’s learn what a functor is and how we can use a functor in C++. What is a functor in…
Read more
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