added comparison operators for Ptr class

This commit is contained in:
Marc Zinnschlag 2010-07-27 18:04:52 +08:00 committed by apreiml
parent 3f8c8c33f5
commit 0ff742fb6c

View file

@ -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<right.mRefData;
}
inline bool operator>= (const Ptr& left, const Ptr& right)
{
return !(left<right);
}
inline bool operator> (const Ptr& left, const Ptr& right)
{
return right<left;
}
inline bool operator<= (const Ptr& left, const Ptr& right)
{
return !(left>right);
}
}
#endif