2024-11-01 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.
2024-11-09 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.
2024-10-31 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.
2024-11-01 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.
2024-11-15 Before discussing perfect forwarding in C++, we need to first understand why perfect forwarding and std::forward
were introduced in C++11. Once we understand the problem, we will see how perfect forwarding helps solve it.
2024-11-16 The std::forward<>
function was introduced in C++ to enable perfect forwarding, allowing arguments to be passed to another function while preserving their original lvalue or rvalue status. In this tutorial we will learn the need for std::forward<>
, and how std::forward<>
works.
2024-11-18 The std::move()
utility function was introduced in C++11. It enables the transfer of resources from one object to another without the cost of deep copying.. In this tutorial we will learn the need for std::move()
, and how std::move()
works.