Implement implicit or explicit conversions to boolean for Sqrat weak pointers.

This commit is contained in:
Sandu Liviu Catalin committed 2016-07-03 03:21:29 +03:00
1 parent 7f50156664
commit e93319a381
1 file changed
+18
+18
View File
@@ -1325,6 +1325,24 @@ public:
return *this;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Checks if there is an associated managed object
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
operator bool () const
{
return m_Ptr != NULL;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Checks if there is NOT an associated managed object
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool operator!() const
{
return m_Ptr == NULL;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Checks whether the managed object exists
///