summaryrefslogtreecommitdiffhomepage
path: root/compat/borrowed-ptr.inl
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-05-05 01:38:07 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-05-05 03:31:21 +0200
commit3f503fd32e456926f271b7d4bc485c91adc7b716 (patch)
treeed7d2f4c501f69fe3535181eb131d69abbeee651 /compat/borrowed-ptr.inl
parent965e81a6bfc1d91041d2af32bf459a76d8c42fc8 (diff)
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;