Пример #1
0
	void reset(T* _p = NULL) {
		swap(IntrusivePtr(_p));
	}
Пример #2
0
	IntrusivePtr& operator=(const IntrusivePtr& other) {
		T* p = other.ptr.load();
		swap(IntrusivePtr(p));
		return *this;
	}
Пример #3
0
	IntrusivePtr exchange(T* other) {
		IntrusivePtr old = swap(IntrusivePtr(other));
		return old;
	}
Пример #4
0
	IntrusivePtr(const IntrusivePtr& other) : ptr(NULL) {
		T* p = other.ptr.load();
		swap(IntrusivePtr(p));
	}
 void reset (T* rhs)
 {
     IntrusivePtr (rhs).swap (*this);
 }
 void reset ()
 {
     IntrusivePtr ().swap (*this);
 }
 IntrusivePtr& operator= (T* rhs)
 {
     IntrusivePtr (rhs).swap (*this);
     return *this;
 }
 IntrusivePtr& operator= (IntrusivePtr<U> const& rhs)
 {
     IntrusivePtr (rhs).swap (*this);
     return *this;
 }