Move wxObjectEventFunctor::operator() definition after wxEvtHandler
declaration as it uses call through a pointer to member of this class and Sun
CC refuses to compile this without having the full class declaration.
Closes #12452.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65658
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
: m_handler( handler ), m_method( method )
{ }
: m_handler( handler ), 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 IsMatching(const wxEventFunctor& functor) const
{
virtual bool IsMatching(const wxEventFunctor& functor) const
{
WX_DEFINE_ARRAY_WITH_DECL_PTR(wxEvtHandler *, wxEvtHandlerArray, class WXDLLIMPEXP_BASE);
WX_DEFINE_ARRAY_WITH_DECL_PTR(wxEvtHandler *, wxEvtHandlerArray, class WXDLLIMPEXP_BASE);
+
+// Define an inline method of wxObjectEventFunctor which couldn't be defined
+// before wxEvtHandler declaration: at least Sun CC refuses to compile function
+// calls through pointer to member for forward-declared classes (see #12452).
+inline void wxObjectEventFunctor::operator()(wxEvtHandler *handler, wxEvent& event)
+{
+ wxEvtHandler * const realHandler = m_handler ? m_handler : handler;
+
+ (realHandler->*m_method)(event);
+}
+
// ----------------------------------------------------------------------------
// wxEventConnectionRef represents all connections between two event handlers
// and enables automatic disconnect when an event handler sink goes out of
// ----------------------------------------------------------------------------
// wxEventConnectionRef represents all connections between two event handlers
// and enables automatic disconnect when an event handler sink goes out of