mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 00:36:46 +00:00
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();
|
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