C++: Using the Move Constructor & Move Assignment Operator
C++ 20
| Expert
- 11 Videos | 1h 23m 7s
- Includes Assessment
- Earns a Badge
References are an important part of C++, and a little-known fact about references is that there are actually two types of references: l-value and r-value. In this course, explore those two reference types by learning how to use the syntax and semantics of r-value references to extend the lifespan of transient values. Then, implement the move assignment operator and move constructor, using r-value references as their input arguments, to reduce the number of unnecessary copies created in your C++ programs. Finally, work with Resource Acquisition Is Initialization (RAII) to use smart pointers as a way to bypass complex rules, such as the rule of three and the rule of five, allowing you to follow the simplest rule of all - the rule of 0.
WHAT YOU WILL LEARN
-
discover the key concepts covered in this coursecontrast l-values and r-valuescreate l-value and r-value references using the & and && operatorsimplement move constructors and move assignment operatorsillustrate how extraneous copies of objects can be created when not using r-value referencesrecognize the efficiency improvements triggered by move constructors
-
define a move assignment operatoroutline the features of the move assignment operatoroutline how resource acquisition is initialization (RAII) results in simpler and less error-prone codelist the benefits of RAIIsummarize the key concepts covered in this course
IN THIS COURSE
-
1.Course Overview2m 6sUP NEXT
-
2.Contrasting L-Values and R-Values6m 54s
-
3.Using L-Value and R-Value References5m 24s
-
4.Implementing the Rule of 510m 37s
-
5.Illustrating the Need for R-value References7m 10s
-
6.Illustrating the Advantages of Move Constructors7m 33s
-
7.Using Move Assignment Operators8m 29s
-
8.Outlining Features of the Move Assignment Operator10m 58s
-
9.The RAII Paradigm9m 36s
-
10.Using RAII and the Rule of 011m 32s
-
11.Course Summary2m 48s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion of this course, which can be shared on any social network or business platform
Digital badges are yours to keep, forever.