Added the conversion to unspecfied_bool to all smart pointers, added T& operator* to wxObjectDataPtr
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51118 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user