Created KeuValuePair structure template

This commit is contained in:
Alex Alvarado
2022-04-11 20:45:37 +02:00
parent b2a9a58a60
commit 2da059d4e5

24
include/KeyValuePair.hpp Normal file
View File

@ -0,0 +1,24 @@
#ifndef KeyValuePairH
#define KeyValuePairH
template <typename K, typename V>
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