摘要 |
<p>A non-intrusive smart pointer (10) for providing memory management and type-safe homogeneous linkage for heterogeneous smart pointers is provided. A linked list of smart pointers is provided to represent a reference count of an object (30) pointed to by the smart pointers. A base common to all smart pointers is provided to permit pointers to different sub-objects of the same object to be members of a single ring (100). A class template for generating a different class of smart pointer for each class of object for which a smart pointer is used is provided. The class template provides member functions to generate smart pointer classes specific to the respective classes of objects controlled by the smart pointers to maintain type safety. In addition, member function templates of the class function are provided, to enable automatic conversion between smart pointers of different classes within the same class hierarchy.</p> |