C++: Using the Move Constructor & Move Assignment Operator
C++
| 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
-
2m 6s
-
6m 54s
-
5m 24s
-
10m 37s
-
7m 10s
-
7m 33s
-
8m 29s
-
10m 58s
-
9m 36s
-
11m 32s
-
2m 48s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.
Digital badges are yours to keep, forever.