From b7c871eed76a16991fe5a094a6e2d37cee6dd493 Mon Sep 17 00:00:00 2001 From: JapaMala Date: Sat, 2 Aug 2014 17:12:19 +0530 Subject: [PATCH] gave t_matglossPair a few operator overloads so it can be used in std::map --- library/include/Types.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/library/include/Types.h b/library/include/Types.h index 5412b443b..6b175d180 100644 --- a/library/include/Types.h +++ b/library/include/Types.h @@ -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