diff --git a/headers/private/shared/Referenceable.h b/headers/private/shared/Referenceable.h index d6d9c312f3..9455866080 100644 --- a/headers/private/shared/Referenceable.h +++ b/headers/private/shared/Referenceable.h @@ -61,7 +61,7 @@ public: } - template + template BReference(const BReference& other) : fObject(NULL) @@ -131,7 +131,7 @@ public: return *this; } - template + template BReference& operator=(const BReference& other) { SetTo(other.Get()); diff --git a/headers/private/shared/WeakReferenceable.h b/headers/private/shared/WeakReferenceable.h index 376ae294b4..c09bb0c27d 100644 --- a/headers/private/shared/WeakReferenceable.h +++ b/headers/private/shared/WeakReferenceable.h @@ -87,7 +87,7 @@ public: SetTo(other); } - template + template BWeakReference(const BReference& other) : fPointer(NULL) @@ -95,7 +95,7 @@ public: SetTo(other.Get()); } - template + template BWeakReference(const BWeakReference& other) : fPointer(NULL) @@ -126,7 +126,7 @@ public: } } - template + template void SetTo(const BWeakReference& other) { // Just a compiler check if the types are compatible. @@ -136,8 +136,8 @@ public: Unset(); - if (other.Get()) { - fPointer = const_cast(other.Get()); + if (other.PrivatePointer()) { + fPointer = const_cast(other.PrivatePointer()); fPointer->AcquireReference(); } } @@ -172,13 +172,6 @@ public: return BReference(object, true); } - /*! Do not use this if you do not know what you are doing. The WeakPointer - is for internal use only. */ - const WeakPointer* Get() const - { - return fPointer; - } - BWeakReference& operator=(const BWeakReference& other) { if (this == &other) @@ -200,14 +193,14 @@ public: return *this; } - template + template BWeakReference& operator=(const BReference& other) { SetTo(other.Get()); return *this; } - template + template BWeakReference& operator=(const BWeakReference& other) { SetTo(other); @@ -224,6 +217,14 @@ public: return fPointer != other.fPointer; } + /*! Do not use this if you do not know what you are doing. The WeakPointer + is for internal use only. + */ + const WeakPointer* PrivatePointer() const + { + return fPointer; + } + private: WeakPointer* fPointer; };