1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-03-03 14:11:05 +01:00

32 lines
567 B
C
Raw Normal View History

2018-07-21 16:13:18 +02:00
#ifndef KV_H
#define KV_H
template <class KEY, class VALUE>
2018-07-21 16:13:18 +02:00
class KV {
public:
KV(const KEY &key, const VALUE &value) : _key(key), _value(value) {}
2018-07-21 16:13:18 +02:00
const KEY &key() const {return _key;}
const VALUE &value() const {return _value;}
2018-07-21 16:13:18 +02:00
bool operator==(const KV &other) const
{
return (_key == other._key && _value == other._value);
}
bool operator<(const KV &other) const
{
if (_key < other._key)
return true;
else if (_key > other._key)
return false;
else
return _value < other._value;
}
2018-07-21 16:13:18 +02:00
private:
KEY _key;
VALUE _value;
2018-07-21 16:13:18 +02:00
};
#endif // KV_H