From 2da059d4e5b73b7f742e97926123c24eef3bc81f Mon Sep 17 00:00:00 2001 From: Alex Alvarado <931857-alexb737@users.noreply.gitlab.com> Date: Mon, 11 Apr 2022 20:45:37 +0200 Subject: [PATCH] Created KeuValuePair structure template --- include/KeyValuePair.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 include/KeyValuePair.hpp diff --git a/include/KeyValuePair.hpp b/include/KeyValuePair.hpp new file mode 100644 index 0000000..f0cfa5a --- /dev/null +++ b/include/KeyValuePair.hpp @@ -0,0 +1,24 @@ +#ifndef KeyValuePairH +#define KeyValuePairH + +template +struct KeyValuePair +{ +public: + KeyValuePair() {} + KeyValuePair(K key, V value) + { + this->Key = new K(key); + this->Value = new V(value); + } + + K *Key = nullptr; + V *Value = nullptr; + + K GetKey() { return (K)*Key; } + V GetValue() { return (V)*Value; } + + void SetKey(K Key) { this->Key = &Key; } + void SetValue(V Value) { this->Value = &Value; } +}; +#endif \ No newline at end of file