1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-02-21 20:27:13 +01:00

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

This commit is contained in:
Sandu Liviu Catalin 2016-07-03 03:21:29 +03:00
parent 7f50156664
commit e93319a381

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
///