From d973b12dcdf90907bc63937153d0e7be17510e14 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 18 Aug 2019 03:19:48 -0400 Subject: [PATCH] BooObject: Make ObjToken operator bool explicit Makes explicit conversions to bool necessary to prevent error-prone conversions to bool. --- include/boo/BooObject.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boo/BooObject.hpp b/include/boo/BooObject.hpp index a819836..611b47a 100644 --- a/include/boo/BooObject.hpp +++ b/include/boo/BooObject.hpp @@ -69,7 +69,7 @@ public: T* cast() const noexcept { return static_cast(m_obj); } - operator bool() const noexcept { return m_obj != nullptr; } + explicit operator bool() const noexcept { return m_obj != nullptr; } void reset() noexcept { if (m_obj) m_obj->decrement();