aboutsummaryrefslogtreecommitdiff
path: root/zencore/include
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-05-24 13:16:06 +0200
committerStefan Boberg <[email protected]>2021-05-24 13:16:06 +0200
commit6807a2afcf431c5c609b0606c483ea17d0e83944 (patch)
tree1783ce55ccec9569ebf1ee532be07d9750f50af0 /zencore/include
parentMade Min/Max functions constexpr (diff)
downloadzen-6807a2afcf431c5c609b0606c483ea17d0e83944.tar.xz
zen-6807a2afcf431c5c609b0606c483ea17d0e83944.zip
Added RefPtr::IsNull()
Diffstat (limited to 'zencore/include')
-rw-r--r--zencore/include/zencore/refcount.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/zencore/include/zencore/refcount.h b/zencore/include/zencore/refcount.h
index de7d315f4..e6cdbc540 100644
--- a/zencore/include/zencore/refcount.h
+++ b/zencore/include/zencore/refcount.h
@@ -58,9 +58,10 @@ public:
inline RefPtr(T* Ptr) : m_Ref(Ptr) { m_Ref && m_Ref->AddRef(); }
inline ~RefPtr() { m_Ref && m_Ref->Release(); }
- inline explicit operator bool() const { return m_Ref != nullptr; }
- inline operator T*() const { return m_Ref; }
- inline T* operator->() const { return m_Ref; }
+ [[nodiscard]] inline bool IsNull() const { return m_Ref == nullptr; }
+ inline explicit operator bool() const { return m_Ref != nullptr; }
+ inline operator T*() const { return m_Ref; }
+ inline T* operator->() const { return m_Ref; }
inline std::strong_ordering operator<=>(const RefPtr& Rhs) const = default;