Instructions

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 2

DownloadInstructions
Open PDF In BrowserView PDF
Lab 1: BigFive Class
The Big Three can be expanded to the Big Five, which include a constructor and an overloaded assignment
operator that “steal” all the data from the parameter object.
We know that the job of a constructor is to create a new object, and we know that the job of a copy
constructor is to create a new object that is an exact copy of the object passed as a parameter. The move
constructor also creates a new object, but instead of allocating new memory (as the copy constructor does), it
“steals” any dynamic data that belongs to the parameter object. Since the parameter object will not be used
any longer, it is good practice to null its member pointers and reset any additional member variables to default
values.
The move assignment operator works in the same manner by “stealing” the data from the parameter object
(note that, as with the overloaded assignment operator, the calling object must be created before calling this
function).
The move constructor passes an object of the same class, just like the copy constructor. Although you will not
use the const modifier for the parameter object of the move constructor, because you are re-setting the
parameter object, the functions will look the same to the compiler (the const modifier for parameters does not
make any difference to the compiler). Then how do we make these functions different? By adding a second
reference to the parameter object of the move constructor (&&)—note that the syntax for the
implementation is the same as if it were a single reference. The move assignment operator will need a double
reference as well.
The call statement to these functions needs to use the move function from the STL header  (the move
function from the STL  header overloads this function). Note that the move function does NOT
move anything, but it acts as a helper function. Why?
You may find some help by browsing the link below, but you will still need to think carefully about your
implementation.
https://msdn.microsoft.com/en-us/library/dd293665.aspx
(Go to next page for a visual example.)

DArray Class Example



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.5
Linearized                      : Yes
Author                          : Gabriela
Company                         : Hewlett-Packard Company
Create Date                     : 2019:02:06 09:14:36-08:00
Modify Date                     : 2019:02:06 09:14:36-08:00
Source Modified                 : D:20190205204648
Language                        : EN-US
Tagged PDF                      : Yes
XMP Toolkit                     : Adobe XMP Core 5.6-c015 84.159810, 2016/09/10-02:41:30
Metadata Date                   : 2019:02:06 09:14:36-08:00
Creator Tool                    : Acrobat PDFMaker 17 for Word
Document ID                     : uuid:2622124f-e154-4562-ae9b-a1518f0c0b13
Instance ID                     : uuid:727a258b-24da-477c-a596-206eaf22a24e
Subject                         : 3
Format                          : application/pdf
Creator                         : Gabriela
Producer                        : Adobe PDF Library 15.0
Page Layout                     : OneColumn
Page Count                      : 2
EXIF Metadata provided by EXIF.tools

Navigation menu