diff --git a/panda/src/express/weakPointerToBase.I b/panda/src/express/weakPointerToBase.I index 1c831529a1..5ba737d507 100644 --- a/panda/src/express/weakPointerToBase.I +++ b/panda/src/express/weakPointerToBase.I @@ -292,6 +292,51 @@ operator >= (To *other) const { return (To *)_void_ptr >= other; } +/** + * + */ +template +INLINE bool WeakPointerToBase:: +operator == (nullptr_t) const { + return _void_ptr == nullptr; +} + +/** + * + */ +template +INLINE bool WeakPointerToBase:: +operator != (nullptr_t) const { + return _void_ptr != nullptr; +} + +/** + * + */ +template +INLINE bool WeakPointerToBase:: +operator > (nullptr_t) const { + return _void_ptr != nullptr; +} + +/** + * + */ +template +INLINE bool WeakPointerToBase:: +operator <= (nullptr_t) const { + return _void_ptr == nullptr; +} + +/** + * + */ +template +INLINE bool WeakPointerToBase:: +operator >= (nullptr_t) const { + return true; +} + /** * */ @@ -392,6 +437,15 @@ operator < (const To *other) const { return (To *)_void_ptr < other; } +/** + * + */ +template +INLINE bool WeakPointerToBase:: +operator < (nullptr_t) const { + return false; +} + /** * */ diff --git a/panda/src/express/weakPointerToBase.h b/panda/src/express/weakPointerToBase.h index 4870ef21d8..20505191e3 100644 --- a/panda/src/express/weakPointerToBase.h +++ b/panda/src/express/weakPointerToBase.h @@ -60,6 +60,12 @@ public: INLINE bool operator <= (To *other) const; INLINE bool operator >= (To *other) const; + INLINE bool operator == (nullptr_t) const; + INLINE bool operator != (nullptr_t) const; + INLINE bool operator > (nullptr_t) const; + INLINE bool operator <= (nullptr_t) const; + INLINE bool operator >= (nullptr_t) const; + INLINE bool operator == (const WeakPointerToBase &other) const; INLINE bool operator != (const WeakPointerToBase &other) const; INLINE bool operator > (const WeakPointerToBase &other) const; @@ -73,6 +79,7 @@ public: INLINE bool operator >= (const PointerToBase &other) const; #endif // WIN32_VC INLINE bool operator < (const To *other) const; + INLINE bool operator < (nullptr_t) const; INLINE bool operator < (const WeakPointerToBase &other) const; INLINE bool operator < (const PointerToBase &other) const; #endif // CPPPARSER