Created KeuValuePair structure template
This commit is contained in:
24
include/KeyValuePair.hpp
Normal file
24
include/KeyValuePair.hpp
Normal 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
|
||||
Reference in New Issue
Block a user