#include <SmartPtr.h>
This class wraps a pointer to on object of class T, an keeps track of the number of references to the same object. When the number of references becomes zero, the referenced object is destroyed.
If the non-constant version of operator->() is called for an object with number of references grater than 1, a copy of the referenced object is performed by calling its member function CreateObject(). This implies that class T must have this function implemented.
The need for requiring a function T::CreateObject() is that we don't know whether we have a pointer to an object T or to a class derived from T. Thus, the only solution is to force T to have a virtual function that will create and copy the correct type of object.
Definition at line 62 of file SmartPtr.h.
1.2.18