template struct mrpt::copiable_NULL_ptr_basic¶
A wrapper class for pointers that, if copied with the “=” operator, should be set to nullptr in the copy.
See also:
safe_ptr, non_copiable_ptr, copiable_NULL_ptr
#include <mrpt/core/safe_pointers.h> template <class T> struct copiable_NULL_ptr_basic { // construction copiable_NULL_ptr_basic(); copiable_NULL_ptr_basic(const copiable_NULL_ptr_basic<T>&); // methods copiable_NULL_ptr_basic<T>& operator = (T* p); copiable_NULL_ptr_basic<T>& operator = (const copiable_NULL_ptr_basic<T>&); bool operator == (const T* o) const; bool operator == (const copiable_NULL_ptr_basic<T>& o) const; bool operator != (const T* o) const; bool operator != (const copiable_NULL_ptr_basic<T>& o) const; T*& get(); const T*& get() const; T*& operator -> (); const T*& operator -> () const; }; // direct descendants template <class T> struct copiable_NULL_ptr;