Merge branch 'frohlich/weak' into next

This commit is contained in:
Tim Moore 2009-09-17 12:18:33 +02:00
commit 9cbbe55598
2 changed files with 4 additions and 0 deletions

View File

@ -98,6 +98,8 @@ public:
private:
void assign(T* p)
{ get(p); put(); _ptr = p; }
void assignNonRef(T* p)
{ put(); _ptr = p; }
void get(const T* p) const
{ T::get(p); }

View File

@ -27,6 +27,8 @@ public:
{ }
SGWeakPtr(const SGWeakPtr& p) : mWeakData(p.mWeakData)
{ }
SGWeakPtr(T* ptr)
{ assign(ptr); }
template<typename U>
SGWeakPtr(const SGSharedPtr<U>& p)
{ SGSharedPtr<T> sharedPtr = p; assign(sharedPtr.get()); }