Changeset 461 for library/bdm/shared_ptr.h
- Timestamp:
- 07/31/09 13:06:49 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/shared_ptr.h
r420 r461 28 28 template <typename T> 29 29 class shared_ptr { 30 template<class U> friend class shared_ptr; 31 30 32 private: 31 33 T *payload; … … 51 53 //! If other is empty, constructs an empty shared_ptr; otherwise, 52 54 //! constructs a shared_ptr that shares ownership with other. 53 shared_ptr(const shared_ptr &other): 55 shared_ptr(const shared_ptr<T> &other): 56 payload(other.payload), 57 refCnt(other.refCnt) 58 { 59 add_ref(); 60 } 61 62 //! If other is empty, constructs an empty shared_ptr; otherwise, 63 //! constructs a shared_ptr that shares ownership with other. 64 template<typename U> 65 shared_ptr(const shared_ptr<U> &other): 54 66 payload(other.payload), 55 67 refCnt(other.refCnt)