aboutsummaryrefslogtreecommitdiff
path: root/Project1
diff options
context:
space:
mode:
authorConnor McDowell <[email protected]>2024-02-22 19:03:13 -0800
committerConnor McDowell <[email protected]>2024-02-22 19:03:13 -0800
commit71af5a377a536bcd08036e5cb4631c78370802a2 (patch)
tree713d91ee96614026ba37f52b19ae275f08f9cd64 /Project1
parentworking with moves (diff)
downloadin-class-exercise-14-connormcdowell275-main.tar.xz
in-class-exercise-14-connormcdowell275-main.zip
heckinHEADmain
Diffstat (limited to 'Project1')
-rw-r--r--Project1/contact.cpp15
-rw-r--r--Project1/contact.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/Project1/contact.cpp b/Project1/contact.cpp
index e4ba37e..95c26f6 100644
--- a/Project1/contact.cpp
+++ b/Project1/contact.cpp
@@ -31,6 +31,21 @@ contact::contact(contact&& move)
//also *this = std::move(move);
}
+contact& contact::operator=(contact&& rhs)
+{
+ if (this != &rhs)
+ {
+ _firstName = rhs._firstName;
+ _lastName = rhs._lastName;
+ _streetAddress = rhs._streetAddress;
+ _city = rhs._city;
+ _state = rhs._state;
+ _zip = rhs._zip;
+ _email = rhs._email;
+ }
+ return *this;
+}
+
void contact::Set_firstName(const char* firstName)
{
diff --git a/Project1/contact.h b/Project1/contact.h
index 65d1b6f..90791b7 100644
--- a/Project1/contact.h
+++ b/Project1/contact.h
@@ -19,6 +19,7 @@ public:
contact& operator=(const contact& rhs);
contact(contact&& move);
+ contact& operator=(contact&& rhs);
const char* Get_firstName();
void Set_firstName(const char* firstName);