NSDMI: Copy and Move Constructors

In this lesson, you will learn how non-static data member initialization works with move and copy constructors.

Copy constructor

The compiler initializes the fields in all the constructors, including the copy and move constructors. However, when a copy or move constructor is the default, there’s no need to perform that extra initialization.

Now, let’s update our previous examples with copy constructors:

Get hands-on with 1300+ tech skills courses.