39 : m_ref_count(NULL), m_ptr(NULL)
57 : m_ref_count(NULL), m_ptr(NULL)
61 m_ref_count =
new unsigned int(1);
114 return !(*
this < that) && !(that < *
this);
126 return (*
this < that) || (that < *
this);
139 return m_ptr < that.m_ptr;
151 return !(that < *
this);
175 return !(*
this < that);
230 assert(
this != &that );
232 m_ref_count = that.m_ref_count;
253 if ( !(*m_ref_count) )
smart_ptr()
Default constructor.
T * pointer
Pointer on the type of the stored data.
bool operator<(const self_type &that) const
"Less than" operator.
pointer operator->()
Dereference operator.
~smart_ptr()
Destructor. The memory is freed only if no more smart_ptr point on it.
bool operator>(const self_type &that) const
"Greater than" operator.
A pointer with a reference counter.
T & reference
Reference on the type of the stored data.
bool operator>=(const self_type &that) const
"Greater or equal" operator.
bool operator==(const self_type &that) const
Equality operator.
bool operator<=(const self_type &that) const
"Less or equal" operator.
self_type & operator=(const self_type &that)
Assignment operator.
bool operator!=(const self_type &that) const
Disequality operator.
reference operator*()
Dereference operator.