C++: Using the Move Constructor & Move Assignment Operator

C++    |    Expert
  • 11 videos | 1h 23m 7s
  • Includes Assessment
  • Earns a Badge
Rating 4.3 of 6 users Rating 4.3 of 6 users (6)
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 course
    Contrast l-values and r-values
    Create l-value and r-value references using the & and && operators
    Implement move constructors and move assignment operators
    Illustrate how extraneous copies of objects can be created when not using r-value references
    Recognize the efficiency improvements triggered by move constructors
  • Define a move assignment operator
    Outline the features of the move assignment operator
    Outline how resource acquisition is initialization (raii) results in simpler and less error-prone code
    List the benefits of raii
    Summarize the key concepts covered in this course

IN THIS COURSE

  • 2m 6s
  • 6m 54s
  • Locked
    3.  Using L-Value and R-Value References
    5m 24s
  • Locked
    4.  Implementing the Rule of 5
    10m 37s
  • Locked
    5.  Illustrating the Need for R-value References
    7m 10s
  • Locked
    6.  Illustrating the Advantages of Move Constructors
    7m 33s
  • Locked
    7.  Using Move Assignment Operators
    8m 29s
  • Locked
    8.  Outlining Features of the Move Assignment Operator
    10m 58s
  • Locked
    9.  The RAII Paradigm
    9m 36s
  • Locked
    10.  Using RAII and the Rule of 0
    11m 32s
  • Locked
    11.  Course Summary
    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.

YOU MIGHT ALSO LIKE

Rating 4.5 of 13 users Rating 4.5 of 13 users (13)
Rating 4.5 of 53 users Rating 4.5 of 53 users (53)
Rating 4.4 of 9 users Rating 4.4 of 9 users (9)

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE

Rating 4.4 of 15 users Rating 4.4 of 15 users (15)
Rating 4.5 of 13 users Rating 4.5 of 13 users (13)
Rating 4.1 of 9 users Rating 4.1 of 9 users (9)