From 71af5a377a536bcd08036e5cb4631c78370802a2 Mon Sep 17 00:00:00 2001 From: Connor McDowell Date: Thu, 22 Feb 2024 19:03:13 -0800 Subject: heckin --- Project1/contact.cpp | 15 +++++++++++++++ Project1/contact.h | 1 + 2 files changed, 16 insertions(+) (limited to 'Project1') 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); -- cgit v1.2.3