Class xlifepp::SmartPtr#
-
template<typename T, template<class> class OwnershipPolicy, class ConversionPolicy, template<class> class CheckingPolicy, template<class> class StoragePolicy, template<class> class ConstnessPolicy>
class SmartPtr : public StoragePolicy<T>, public OwnershipPolicy<StoragePolicy<T>::InitPointerType>, public CheckingPolicy<StoragePolicy<T>::StoredType>, public ConversionPolicy#
-
Smart pointers are objects which store pointers to dynamically allocated (heap) objects.
They behave much like built-in C++ pointers except that they automatically delete the object pointed to at the appropriate time. Conceptually, smart pointers are seen as owning the object pointed to, and thus responsible for deletion of the object when it is no longer needed.
Note
The implementation is adapted from Modern C++ Design: Generic Programming and Design Patterns Applied
Public Functions
-
inline SmartPtr()#
-
default constructor
-
template<typename T1, template<class> class OP1, class CP1, template<class> class KP1, template<class> class SP1, template<class> class CNP1>
inline SmartPtr(const SmartPtr<T1, OP1, CP1, KP1, SP1, CNP1> &rhs)#
-
copy constructor
-
inline SmartPtr(CopyArg &rhs)#
-
constructor frm copy argument
-
inline explicit SmartPtr(ExplicitArg p)#
-
constructor from explicit argument
-
inline SmartPtr(ImplicitArg p)#
-
basic constructor from implicit argument
-
inline SmartPtr(ImplicitArg p, bool isAllocated)#
-
constructor from implicit argument
-
inline SmartPtr(RefToValue<SmartPtr> rhs)#
-
constructor
-
inline SmartPtr(SmartPointerNullType smNull)#
-
constructor from null pointer
-
template<typename T1, template<class> class OP1, class CP1, template<class> class KP1, template<class> class SP1, template<class> class CNP1>
inline SmartPtr(SmartPtr<T1, OP1, CP1, KP1, SP1, CNP1> &rhs)#
-
copy constructor (non const arg)
-
inline ~SmartPtr()#
-
destructor
-
inline SmartPtr &operator=(const SmartPointerNullType&)#
-
assignment operator from null pointer
-
inline SmartPtr()#