From f9cc9a1abedfffba8d5aa0a6c80dc1cf2a6baffa Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 12 Nov 2020 15:35:02 +0800 Subject: [PATCH] Fix build --- nel/include/nel/misc/deep_ptr.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nel/include/nel/misc/deep_ptr.h b/nel/include/nel/misc/deep_ptr.h index f0b5b1f79..76493c6e4 100644 --- a/nel/include/nel/misc/deep_ptr.h +++ b/nel/include/nel/misc/deep_ptr.h @@ -46,9 +46,20 @@ public: NL_FORCE_INLINE bool operator==(const T *p) const { return (m == p) || (m && p && *m == *p); } NL_FORCE_INLINE bool operator!=(const T *p) const { return !(*this == p); } + NL_FORCE_INLINE bool operator==(const T &p) const { return (m == &p) || (m && *m == p); } + NL_FORCE_INLINE bool operator!=(const T &p) const { return !(*this == p); } + + NL_FORCE_INLINE bool operator==(long int p) const { return (*this == (const T *)(ptrdiff_t)p); } //< == NULL + NL_FORCE_INLINE bool operator!=(long int p) const { return (*this != (const T *)(ptrdiff_t)p); } //< != NULL + NL_FORCE_INLINE bool operator==(int p) const { return (*this == (const T *)(ptrdiff_t)p); } //< == 0 NL_FORCE_INLINE bool operator!=(int p) const { return (*this != (const T *)(ptrdiff_t)p); } //< != 0 +#ifdef NL_CPP14 + NL_FORCE_INLINE bool operator==(nullptr_t p) const { return (*this == (const T *)(ptrdiff_t)p); } //< == nullptr + NL_FORCE_INLINE bool operator!=(nullptr_t p) const { return (*this != (const T *)(ptrdiff_t)p); } //< != nullptr +#endif + NL_FORCE_INLINE T &operator*() { return *m; } NL_FORCE_INLINE const T &operator*() const { return *m; } NL_FORCE_INLINE T *operator->() { return m; }