]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/ptr_scpd.h
add an assert indicating that old code overriding OnExecute() must be updated with 2.9
[wxWidgets.git] / include / wx / ptr_scpd.h
index 100e6bdd0a97aee09e9aaebbe06fcc288843904d..2ae40220c97f492b461c9e6ec8f7b0441c7708c7 100644 (file)
@@ -55,6 +55,14 @@ public:
            delete m_ptr;
     }
                                     
+    // test for pointer validity: defining conversion to unspecified_bool_type
+    // and not more obvious bool to avoid implicit conversions to integer types
+    typedef T *(wxScopedPtr<T>::*unspecified_bool_type)() const;
+    operator unspecified_bool_type() const
+    {
+        return m_ptr ? &wxScopedPtr<T>::get : NULL;
+    }
+
     void reset(T * ptr = NULL)      
     {                               
         if (m_ptr != ptr)