From 0ff742fb6c875682fd2eb7f6e35f7228dc1cb7a0 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 27 Jul 2010 18:04:52 +0800 Subject: [PATCH] added comparison operators for Ptr class --- apps/openmw/mwworld/ptr.hpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/apps/openmw/mwworld/ptr.hpp b/apps/openmw/mwworld/ptr.hpp index 44e480ab8..778a66b67 100644 --- a/apps/openmw/mwworld/ptr.hpp +++ b/apps/openmw/mwworld/ptr.hpp @@ -121,6 +121,36 @@ namespace MWWorld return *data.getCreatureStats(); } }; + + inline bool operator== (const Ptr& left, const Ptr& right) + { + return left.mRefData==right.mRefData; + } + + inline bool operator!= (const Ptr& left, const Ptr& right) + { + return !(left==right); + } + + inline bool operator< (const Ptr& left, const Ptr& right) + { + return left.mRefData= (const Ptr& left, const Ptr& right) + { + return !(left (const Ptr& left, const Ptr& right) + { + return rightright); + } } #endif