diff options
| author | rPatrickWarner <[email protected]> | 2024-02-26 18:57:43 -0800 |
|---|---|---|
| committer | rPatrickWarner <[email protected]> | 2024-02-26 18:57:43 -0800 |
| commit | 49132eb2125d7abe6d24279bb5b6e5c79b88dffd (patch) | |
| tree | a7fbb5eb886b7d61c05bc6fa4be14eb767621e68 /Homework8/MyStructures/Contact.hpp | |
| parent | add deadline (diff) | |
| download | homework-8-reecepwarner-49132eb2125d7abe6d24279bb5b6e5c79b88dffd.tar.xz homework-8-reecepwarner-49132eb2125d7abe6d24279bb5b6e5c79b88dffd.zip | |
init
Diffstat (limited to 'Homework8/MyStructures/Contact.hpp')
| -rw-r--r-- | Homework8/MyStructures/Contact.hpp | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/Homework8/MyStructures/Contact.hpp b/Homework8/MyStructures/Contact.hpp new file mode 100644 index 0000000..f7fda6c --- /dev/null +++ b/Homework8/MyStructures/Contact.hpp @@ -0,0 +1,108 @@ +#ifndef CONTACT_HPP +#define CONTACT_HPP + +namespace MyStructures //variables declared here act as a global variable +{ + template <typename T> + class Contact + { + public: + Contact() = default; + Contact(const char* name, const short age); + + ~Contact() = default; + + Contact(const Contact& copy); //copy constructor + Contact& operator=(const Contact& rhs); //copy assignment + + Contact(Contact&& move); //move constructor + Contact& operator=(Contact&& rhs); //move assignment + + + short GetAge(); + const char* GetName(); + + void SetAge(short age); + void SetName(const char* name); + + void Print(); + + T GetCustomValue(T& newValue); + + private: + const char* name_{}; + short age_{ 0 }; + T custom_value_{}; //one type is declared, it will be custom + + + }; + + + template<typename T> + Contact<T>::Contact(const char* name, const short age) + { + } + + template<typename T> + Contact<T>::Contact(const Contact& copy) + { + } + + template<typename T> + Contact<T>& Contact<T>::operator=(const Contact& rhs) + { + // TODO: insert return statement here + } + + template<typename T> + Contact<T>::Contact(Contact&& move) + { + } + + template<typename T> + Contact<T>& Contact<T>::operator=(Contact&& rhs) + { + // TODO: insert return statement here + } + + + + template<typename T> + short Contact<T>::GetAge() + { + return 0; + } + + template<typename T> + const char* Contact<T>::GetName() + { + return nullptr; + } + + template<typename T> + void Contact<T>::SetAge(short age) + { + } + + template<typename T> + void Contact<T>::SetName(const char* name) + { + } + + template<typename T> + inline void Contact<T>::Print() + { + } + + template<typename T> + T Contact<T>::GetCustomValue(T& newValue) + { + custom_value_ = newValue + return T(); + } + +} + + + +#endif
\ No newline at end of file |