summaryrefslogtreecommitdiff
path: root/src/ref_ptr.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/ref_ptr.hh')
-rw-r--r--src/ref_ptr.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ref_ptr.hh b/src/ref_ptr.hh
index 2c284dae..33a56135 100644
--- a/src/ref_ptr.hh
+++ b/src/ref_ptr.hh
@@ -38,6 +38,14 @@ struct RefPtr
return *this;
}
+ RefPtr& operator=(T* ptr)
+ {
+ release();
+ m_ptr = ptr;
+ acquire();
+ return *this;
+ }
+
[[gnu::always_inline]]
T* operator->() const { return m_ptr; }
[[gnu::always_inline]]