#ifndef CONTACT_HPP #define CONTACT_HPP #include using std::cin; using std::cout; using std::endl; using namespace std; namespace myStructures { template class contact { public: // constructors and destructors. contact() = default; contact(size_t a, string firstName, string lastName, string streetAddress, string city, string state, int zip, string email); ~contact() = default; contact(const contact& copy); // copy constructor contact& operator=(const contact& rhs); // copy assignment contact(contact&& move) noexcept; // move constructor contact& operator=(contact&& rhs) noexcept; // move assignment //getters and setters string Get_firstName(); void Set_firstName(string firstName); string Get_lastName(); void Set_lastName(string lastName); string Get_streetAddress(); void Set_streetAddress(string streetAddress); string Get_city(); void Set_city(string city); string Get_state(); void Set_state(string state); int Get_zip(); void Set_zip(int zip); string Get_email(); void Set_email(string email); size_t Get_a(); void Set_a(size_t a); size_t Get_id(); void Set_id(size_t id); void print(); private: size_t _a = 0; // _a functions as delete bool. if a = 1, the slot is overwritten /*int _id;*/ string _firstName; string _lastName; string _streetAddress; string _city; string _state; int _zip; string _email; C custom_value{}; }; // constructor defs for CLASS CONTACT template contact::contact(size_t a, string firstName, string lastName, string streetAddress, string city, string state, int zip, string email) { } template contact::contact(const contact& copy) { *this = copy; } template contact& contact::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 contact::contact(contact&& move) noexcept { *this = move; } template contact& contact::operator=(contact&& rhs) noexcept { 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 template string contact::Get_firstName() { return _firstName; } template void contact::Set_firstName(string firstName) { _firstName = firstName; } template string contact::Get_lastName() { return _lastName; } template void contact::Set_lastName(string lastName) { _lastName = lastName; } template string contact::Get_streetAddress() { return _streetAddress; } template void contact::Set_streetAddress(string streetAddress) { _streetAddress = streetAddress; } template string contact::Get_city() { return _city; } template void contact::Set_city(string city) { _city = city; } template string contact::Get_state() { return _state; } template void contact::Set_state(string state) { _state = state; } template int contact::Get_zip() { return _zip; } template void contact::Set_zip(int zip) { _zip = zip; } template string contact::Get_email() { return _email; } template void contact::Set_email(string email) { _email = email; } template size_t contact::Get_a() { return _a; } template void contact::Set_a(size_t a) { _a = a; } template void contact::print() { //cout << "Contact number: " << _id << endl; cout << "Full name: " << _firstName << " " << _lastName << endl; cout << "Email: " << _email << endl; cout << "Street Address: " << _streetAddress << endl; cout << "City: " << _city << endl; cout << "State: " << _state << endl; cout << "Zip code: " << _zip << endl; } } #endif CONTACT_HPP