* subscription.
*/
~SmartPointer();
-
+
/**
* Assignment operator for normal
* pointers. The pointer
* automatically and unsubscribes
* to an old one if it exists. It
* will not try to subscribe to a
- * null-pointer, but stilll
+ * null-pointer, but still
* delete the old subscription.
*/
SmartPointer<T,P> & operator= (T *tt);
* and set the pointer to zero.
*/
void clear ();
-
+
/**
* Conversion to normal pointer.
*/
operator T* () const;
-
+
/**
* Dereferencing operator. This
* operator throws an
* pointer is a null pointer.
*/
T& operator * () const;
-
+
/**
* Dereferencing operator. This
* operator throws an
* by the object pointed to.
*/
std::size_t memory_consumption () const;
-
+
private:
/**
* Pointer to the object we want
// requested
if (t == tt)
return *this;
-
+
if (t != 0)
t->unsubscribe(id);
t = tt;
// the same, then this is a no-op
if (&tt == this)
return *this;
-
+
if (t != 0)
t->unsubscribe(id);
t = static_cast<T*>(tt);
// the same, then this is a no-op
if (&tt == this)
return *this;
-
+
if (t != 0)
t->unsubscribe(id);
t = static_cast<T*>(tt);
{
if (t != 0)
t->unsubscribe (id);
-
+
std::swap (t, tt);
if (t != 0)