summaryrefslogtreecommitdiffhomepage
path: root/compat/borrowed-ptr.inl
diff options
context:
space:
mode:
Diffstat (limited to 'compat/borrowed-ptr.inl')
-rw-r--r--compat/borrowed-ptr.inl3
1 files changed, 2 insertions, 1 deletions
diff --git a/compat/borrowed-ptr.inl b/compat/borrowed-ptr.inl
index 05724fcd..a29e6b1c 100644
--- a/compat/borrowed-ptr.inl
+++ b/compat/borrowed-ptr.inl
@@ -215,6 +215,7 @@ template<typename T> T* bptr<T>::get() const noexcept
else
return nullptr;
}
+
template<typename T> T* bptr<T>::operator->() const noexcept
{
auto* ret = get();
@@ -236,7 +237,7 @@ void bptr<T>::swap(bptr& other) noexcept
template<typename T> uint32_t bptr<T>::use_count() const noexcept
{
- if (blk) [[likely]]
+ if (blk && blk->_ptr) [[likely]]
return blk->_count;
else
return 0;