]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/event.h
check for self-assignment in operator=
[wxWidgets.git] / include / wx / event.h
index 70fd7df823d32e6e5e928adedc573a598a4c7492..fb033e636a18a8a0118e95e6cdd748861ef2718b 100644 (file)
@@ -237,12 +237,7 @@ public:
         m_method = method;
     }
 
-    virtual void operator()(wxEvtHandler *handler, wxEvent& event)
-    {
-        wxEvtHandler * const realHandler = m_handler ? m_handler : handler;
-
-        (realHandler->*m_method)(event);
-    }
+    virtual void operator()(wxEvtHandler *handler, wxEvent& event);
 
     virtual bool Matches(const wxEventFunctor& func) const
     {
@@ -397,7 +392,7 @@ class wxEventFunctorMethod
               <
                 Class,
                 EventArg,
-                wxConvertibleTo<Class, wxEvtHandler>::value
+                wxConvertibleTo<Class, wxEvtHandler>::value != 0
               >
 {
 private:
@@ -3401,6 +3396,13 @@ private:
     wxDECLARE_NO_ASSIGN_CLASS(wxEventConnectionRef);
 };
 
+inline void wxObjectEventFunctor::operator()(wxEvtHandler *handler, wxEvent& event)
+{
+    wxEvtHandler * const realHandler = m_handler ? m_handler : handler;
+
+    (realHandler->*m_method)(event);
+}
+
 // Post a message to the given event handler which will be processed during the
 // next event loop iteration.
 //