gave t_matglossPair a few operator overloads so it can be used in std::map

develop
JapaMala 2014-08-02 17:12:19 +05:30
parent 08da62392e
commit b7c871eed7
1 changed files with 13 additions and 0 deletions

@ -38,6 +38,19 @@ namespace DFHack
{
int16_t type;
int32_t index;
bool operator<(const t_matglossPair &b) const
{
if (type != b.type) return (type < b.type);
return (index < b.index);
}
bool operator==(const t_matglossPair &b) const
{
return (type == b.type) && (index == b.index);
}
bool operator!=(const t_matglossPair &b) const
{
return (type != b.type) || (index != b.index);
}
};
template <int SIZE>