added comparison operators for Ptr class

pull/7/head
Marc Zinnschlag 15 years ago
parent 77a0215d53
commit 5d40055b44

@ -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

Loading…
Cancel
Save