Add template for pointer with deep copy and move semantics

develop
kaetemi 4 years ago
parent b884360c0e
commit 66ef424af0

@ -40,7 +40,7 @@ public:
NL_FORCE_INLINE CDeepPtr(T *p) : m(p) { } //< Initializer
NL_FORCE_INLINE CDeepPtr &operator=(T *p) { delete m; m = p; return *this; } //< Initializer
NL_FORCE_INLINE bool operator==(const CDeepPtr &p) const { return (m == p.m) || (m && p.m && *m == *p); }
NL_FORCE_INLINE bool operator==(const CDeepPtr &p) const { return /* (m == p.m) || */ (m && p.m && *m == *p); }
NL_FORCE_INLINE bool operator!=(const CDeepPtr &p) const { return !(*this == p); }
NL_FORCE_INLINE bool operator==(const T *p) const { return (m == p) || (m && p && *m == *p); }

Loading…
Cancel
Save