diff options
| author | Stefan Boberg <[email protected]> | 2023-04-27 14:35:38 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-27 14:35:38 +0200 |
| commit | 88b977d78617c31f61f2a51e96b35ceeb7e9db72 (patch) | |
| tree | 23a34aea9319a9f4dd41fbc39a51a783aeba7f0f /zencore/include | |
| parent | bugfixes (#261) (diff) | |
| download | zen-88b977d78617c31f61f2a51e96b35ceeb7e9db72.tar.xz zen-88b977d78617c31f61f2a51e96b35ceeb7e9db72.zip | |
made Ref<> constructor explicit (#262)
This change makes the Ref<> constructor explicit, which can help avoid unnecessary overheads and other accidents
Diffstat (limited to 'zencore/include')
| -rw-r--r-- | zencore/include/zencore/refcount.h | 2 |
1 files changed, 1 insertions, 1 deletions
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<typename DerivedType> |