From 34bfda8a38921fd67a09a108915542382cc866a6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 16 Jan 2008 02:07:07 +0000 Subject: [PATCH] compilation fixes for standard-conformant compilers and added back implicit conversion of wxWeakRef to T* (part of patch 1870445) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51233 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/weakref.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/include/wx/weakref.h b/include/wx/weakref.h index 99621fca49..4af0b2525a 100644 --- a/include/wx/weakref.h +++ b/include/wx/weakref.h @@ -207,21 +207,14 @@ public: return *this; } - virtual ~wxWeakRef() { Release(); } + virtual ~wxWeakRef() { this->Release(); } // Smart pointer functions - T& operator*() const { return *m_pobj; } - T* operator->() const { return m_pobj; } + T& operator*() const { return *this->m_pobj; } + T* operator->() const { return this->m_pobj; } - T* get() const { return m_pobj; } - - // test for pointer validity: defining conversion to unspecified_bool_type - // and not more obvious bool to avoid implicit conversions to integer types - typedef T *(wxWeakRef::*unspecified_bool_type)() const; - operator unspecified_bool_type() const - { - return this->m_pobj ? &wxWeakRef::get : NULL; - } + T* get() const { return this->m_pobj; } + operator T*() const { return get(); } }; -- 2.45.2