diff --git a/include/wx/any.h b/include/wx/any.h index 8490555be3..2b37bafa5e 100644 --- a/include/wx/any.h +++ b/include/wx/any.h @@ -159,15 +159,17 @@ private: public: \ static bool IsSameClass(const wxAnyValueType* otherType) \ { \ - const wxAnyValueType& inst = *sm_instance.get(); \ - const wxAnyValueType& otherRef = *otherType; \ - return wxTypeId(inst) == wxTypeId(otherRef); \ + return AreSameClasses(*sm_instance.get(), *otherType); \ } \ virtual bool IsSameType(const wxAnyValueType* otherType) const wxOVERRIDE \ { \ return IsSameClass(otherType); \ } \ private: \ + static bool AreSameClasses(const wxAnyValueType& a, const wxAnyValueType& b) \ + { \ + return wxTypeId(a) == wxTypeId(b); \ + } \ static wxAnyValueTypeScopedPtr sm_instance; \ public: \ static wxAnyValueType* GetInstance() \