From b81c61ce06116727ebaef489f174fac6e0be6760 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 3 Nov 2022 00:00:47 +0200 Subject: [PATCH] Add less-than comparison for handles This allows them to be used as keys for maps or binary search. --- source/game/handle.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/game/handle.h b/source/game/handle.h index b08bcf8..1808654 100644 --- a/source/game/handle.h +++ b/source/game/handle.h @@ -1,6 +1,7 @@ #ifndef MSP_GAME_HANDLE_H_ #define MSP_GAME_HANDLE_H_ +#include #include #include "pool.h" @@ -37,6 +38,7 @@ public: explicit operator bool() const { return ptr; } bool operator==(const Handle &other) const = default; + bool operator<(const Handle &other) const { return std::less()(ptr, other.ptr); } }; template -- 2.43.0