aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--My structures/Contact.hpp28
-rw-r--r--Project1/main.cpp3
2 files changed, 25 insertions, 6 deletions
diff --git a/My structures/Contact.hpp b/My structures/Contact.hpp
index f13ace6..17f20c1 100644
--- a/My structures/Contact.hpp
+++ b/My structures/Contact.hpp
@@ -74,25 +74,45 @@ namespace myStructures
template <class C>
contact<C>::contact(const contact& copy)
{
-
+ *this = copy;
}
template <class C>
contact<C>& contact<C>::operator=(const 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;
}
template <class C>
contact<C>::contact(contact&& move)
{
-
+ *this = move;
}
template <class C>
contact<C>& contact<C>::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;
}
// getter and setter defs for CLASS CONTACT
diff --git a/Project1/main.cpp b/Project1/main.cpp
index 14f761b..e4e969a 100644
--- a/Project1/main.cpp
+++ b/Project1/main.cpp
@@ -13,8 +13,7 @@ using namespace myStructures;
int main()
{
- contact<char> newContact;
- contact<int> intContact;
+
return 0;
}