forked from mirror/openmw-tes3mp
added comparison operators for Ptr class
This commit is contained in:
parent
3f8c8c33f5
commit
0ff742fb6c
1 changed files with 30 additions and 0 deletions
|
@ -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…
Reference in a new issue