X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/014b109195afb6be5773df434f2900df325d0774..43b5ebf2a56c593091b0a3250166db5bb53f3fca:/include/wx/weakref.h diff --git a/include/wx/weakref.h b/include/wx/weakref.h index 00e7fa1229..df31c2fdc4 100644 --- a/include/wx/weakref.h +++ b/include/wx/weakref.h @@ -202,13 +202,22 @@ class wxWeakRef : public #ifdef USE_ONLY_STATIC_WEAKREF wxWeakRefStatic #else - wxWeakRefImpl::value> + wxWeakRefImpl::value != 0> #endif { public: + typedef T element_type; + // Default ctor wxWeakRef() { } + // Ctor from the object of this type: this is needed as the template ctor + // below is not used by at least g++4 when a literal NULL is used + wxWeakRef(T *pobj) + { + Assign(pobj); + } + // When we have the full type here, static_cast<> will always work // (or give a straight compiler error). template @@ -224,13 +233,6 @@ public: Assign(wr.get()); } - template - wxWeakRef& operator=(TDerived* pobj) - { - this->Assign(pobj); - return *this; - } - wxWeakRef& operator=(const wxWeakRef& wr) { AssignCopy(wr);