diff --git a/include/loki/SmartPtr.h b/include/loki/SmartPtr.h index dead947..b9b0751 100644 --- a/include/loki/SmartPtr.h +++ b/include/loki/SmartPtr.h @@ -70,12 +70,14 @@ namespace Loki template class HeapStorage { - protected: + public: typedef T* StoredType; /// the type of the pointee_ object typedef T* InitPointerType; /// type used to declare OwnershipPolicy type. typedef T* PointerType; /// type returned by operator-> typedef T& ReferenceType; /// type returned by operator* + protected: + HeapStorage() : pointee_(Default()) {} @@ -107,7 +109,6 @@ namespace Loki template friend typename HeapStorage::StoredType& GetImplRef(HeapStorage& sp); - protected: // Destroys the data stored // (Destruction might be taken over by the OwnershipPolicy) void Destroy() @@ -152,12 +153,14 @@ namespace Loki template class DefaultSPStorage { - protected: + public: typedef T* StoredType; // the type of the pointee_ object typedef T* InitPointerType; /// type used to declare OwnershipPolicy type. typedef T* PointerType; // type returned by operator-> typedef T& ReferenceType; // type returned by operator* + protected: + DefaultSPStorage() : pointee_(Default()) {} @@ -189,7 +192,6 @@ namespace Loki template friend typename DefaultSPStorage::StoredType& GetImplRef(DefaultSPStorage& sp); - protected: // Destroys the data stored // (Destruction might be taken over by the OwnershipPolicy) // @@ -287,6 +289,8 @@ namespace Loki typedef Locker< T > PointerType; /// type returned by operator-> typedef T& ReferenceType; /// type returned by operator* + protected: + LockedStorage() : pointee_( Default() ) {} ~LockedStorage( void ) {} @@ -315,7 +319,6 @@ namespace Loki template friend typename LockedStorage::StoredType& GetImplRef(LockedStorage& sp); - protected: // Destroys the data stored // (Destruction might be taken over by the OwnershipPolicy) void Destroy() @@ -359,12 +362,15 @@ namespace Loki template class ArrayStorage { - protected: + public: + typedef T* StoredType; // the type of the pointee_ object typedef T* InitPointerType; /// type used to declare OwnershipPolicy type. typedef T* PointerType; // type returned by operator-> typedef T& ReferenceType; // type returned by operator* + protected: + ArrayStorage() : pointee_(Default()) {} @@ -396,7 +402,6 @@ namespace Loki template friend typename ArrayStorage::StoredType& GetImplRef(ArrayStorage& sp); - protected: // Destroys the data stored // (Destruction might be taken over by the OwnershipPolicy) void Destroy() @@ -507,6 +512,8 @@ namespace Loki template class RefCountedMT : public ThreadingModel< RefCountedMT

, MX > { + public: + typedef ThreadingModel< RefCountedMT

, MX > base_type; typedef typename base_type::IntType CountType; typedef volatile CountType *CountPtrType; @@ -646,7 +653,7 @@ namespace Loki { class LOKI_EXPORT RefLinkedBase { - public: + protected: RefLinkedBase() { prev_ = next_ = this; } @@ -818,6 +825,8 @@ namespace Loki template struct NoCheck { + protected: + NoCheck() {} @@ -850,6 +859,8 @@ namespace Loki template struct AssertCheck { + protected: + AssertCheck() {} @@ -886,6 +897,8 @@ namespace Loki template struct AssertCheckStrict { + protected: + AssertCheckStrict() {} @@ -940,6 +953,8 @@ namespace Loki template struct RejectNullStatic { + protected: + RejectNullStatic() {} @@ -988,6 +1003,8 @@ namespace Loki template struct RejectNull { + protected: + RejectNull() {} @@ -1022,6 +1039,8 @@ namespace Loki template struct RejectNullStrict { + protected: + RejectNullStrict() {}