From cf00eaa1b4b558aa04b75e175090e4a18ff2d326 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Wed, 8 Jun 2016 16:57:48 +0300 Subject: [PATCH] Implicit conversion to boolean of smart Sqrat pointers so they can be used in conditional expressions. --- include/sqrat/sqratUtil.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/sqrat/sqratUtil.h b/include/sqrat/sqratUtil.h index ee23e56b..05402ae8 100644 --- a/include/sqrat/sqratUtil.h +++ b/include/sqrat/sqratUtil.h @@ -763,6 +763,15 @@ public: } } + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// Checks if there is an associated managed object + /// + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + bool operator bool () const + { + return m_Ptr != NULL; + } + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Checks if there is NOT an associated managed object ///