Changeset 737 for library/bdm/shared_ptr.h
- Timestamp:
- 11/25/09 12:14:38 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/shared_ptr.h
r706 r737 50 50 } 51 51 52 /*! 52 /*! 53 53 Constructs a shared_ptr that owns the pointer p (unless p 54 54 is NULL, in which case this constructor creates an empty … … 123 123 */ 124 124 T *operator->() { 125 if ( !payload) {abort();};// "dereferencing NULL" ); 125 if ( !payload ) { 126 abort(); 127 };// "dereferencing NULL" ); 126 128 return payload; 127 129 } … … 190 192 template<typename U> 191 193 operator shared_ptr<const U>() const { 192 shared_ptr<const U> cptr; 194 shared_ptr<const U> cptr; 193 195 cptr.refCnt = refCnt; 194 196 cptr.payload = payload; … … 227 229 }; 228 230 229 //! Compare shared pointers 231 //! Compare shared pointers 230 232 template<typename T, typename U> 231 233 bool operator== ( shared_ptr<T> const &a, shared_ptr<U> const &b ) { … … 233 235 } 234 236 235 //! Compare shared pointers 237 //! Compare shared pointers 236 238 template<typename T, typename U> 237 239 bool operator!= ( shared_ptr<T> const &a, shared_ptr<U> const &b ) { … … 239 241 } 240 242 241 //! Compare shared pointers 243 //! Compare shared pointers 242 244 template<typename T, typename U> 243 245 bool operator< ( shared_ptr<T> const &a, shared_ptr<U> const &b ) { … … 253 255 */ 254 256 template <typename T> 255 class object_ptr : public shared_ptr<T> 256 { 257 class object_ptr : public shared_ptr<T> { 257 258 public: 258 259 /*! … … 272 273 } 273 274 274 /*! 275 /*! 275 276 Constructs an object_ptr that owns the pointer p. p must 276 277 have been alllocated by new!