]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/weakref.h
Fix emulator compilation with wxX11 after GetMainWindow() renaming.
[wxWidgets.git] / include / wx / weakref.h
index 00e7fa122931b8d8b7317cf33849cc07c7953051..df31c2fdc4abd612c3d8c9859d1c5d07935857b2 100644 (file)
@@ -202,13 +202,22 @@ class wxWeakRef : public
 #ifdef USE_ONLY_STATIC_WEAKREF
                   wxWeakRefStatic<T>
 #else
-                  wxWeakRefImpl<T, wxIsStaticTrackable<T>::value>
+                  wxWeakRefImpl<T, wxIsStaticTrackable<T>::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 <class TDerived>
@@ -224,13 +233,6 @@ public:
         Assign(wr.get());
     }
 
-    template <class TDerived>
-    wxWeakRef<T>& operator=(TDerived* pobj)
-    {
-        this->Assign(pobj);
-        return *this;
-    }
-
     wxWeakRef<T>& operator=(const wxWeakRef<T>& wr)
     {
         AssignCopy(wr);