forked from teamnwah/openmw-tes3coop
added comparison operators for Ptr class
This commit is contained in:
parent
77a0215d53
commit
5d40055b44
1 changed files with 30 additions and 0 deletions
|
@ -121,6 +121,36 @@ namespace MWWorld
|
||||||
return *data.getCreatureStats();
|
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
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue