template struct mrpt::non_copiable_ptr_basic

A wrapper class for pointers that can NOT be copied with “=” operator, raising an exception at runtime if a copy is attempted.

See also:

safe_ptr, non_copiable_ptr, copiable_NULL_ptr

#include <mrpt/core/safe_pointers.h>

template <class T>
struct non_copiable_ptr_basic
{
    // construction

    non_copiable_ptr_basic();
    non_copiable_ptr_basic(const non_copiable_ptr_basic<T>&);
    non_copiable_ptr_basic(const T* p);

    //
methods

    non_copiable_ptr_basic<T>& operator = (T* p);
    non_copiable_ptr_basic<T>& operator = (const non_copiable_ptr_basic<T>&);
    bool operator == (const T* o) const;
    bool operator == (const non_copiable_ptr_basic<T>& o) const;
    bool operator != (const T* o) const;
    bool operator != (const non_copiable_ptr_basic<T>& o) const;
    T*& get();
    const T* get() const;
    T** getPtrToPtr();
    T*& operator -> ();
    const T* operator -> () const;
};

// direct descendants

template <class T>
struct non_copiable_ptr;