November 9, 2024 Move semantics were introduced in C++11 along with R-value references. It allows us to avoid unnecessary copying of resources from one object to another. Instead of copying, we can now move or transfer the resources between objects, essentially transferring the ownership of resources from one object to another. This feature is especially valuable when working with classes that manage dynamic resources, like dynamically allocated memory. In this tutorial, we will look into move semantics and the use of the new std::move()
function.
November 1, 2024 In our previous article, we discussed the differences between L-Value and R-Value in C++ with some examples. In this tutorial, we will introduce L-Value References and R-Value References and explain the exact difference between them.
November 1, 2024 R-Values were introduced in C++11. Now, in C++, expressions can be categorized as L-Values or R-Values, and understanding the differences between L-Value and R-Value is important when dealing with assignments, function returns, and references. In this tutorial, we will discuss L-Values and R-Values in detail, and this will act as a foundation for move semantics in upcoming tutorials.
October 31, 2024 In this tutorial, we will discuss the problem with temporary objects and references in old C++, so that we get a clear picture of what kind of problems the R-Value References & Move Semantics in C++11 are trying to solve.