From 88b977d78617c31f61f2a51e96b35ceeb7e9db72 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Thu, 27 Apr 2023 14:35:38 +0200 Subject: made Ref<> constructor explicit (#262) This change makes the Ref<> constructor explicit, which can help avoid unnecessary overheads and other accidents --- zencore/include/zencore/refcount.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zencore/include') diff --git a/zencore/include/zencore/refcount.h b/zencore/include/zencore/refcount.h index 32c282600..f0bb6b85e 100644 --- a/zencore/include/zencore/refcount.h +++ b/zencore/include/zencore/refcount.h @@ -131,7 +131,7 @@ class Ref public: inline Ref() = default; inline Ref(const Ref& Rhs) : m_Ref(Rhs.m_Ref) { m_Ref && m_Ref->AddRef(); } - inline Ref(T* Ptr) : m_Ref(Ptr) { m_Ref && m_Ref->AddRef(); } + inline explicit Ref(T* Ptr) : m_Ref(Ptr) { m_Ref && m_Ref->AddRef(); } inline ~Ref() { m_Ref && m_Ref->Release(); } template -- cgit v1.2.3