diff options
Diffstat (limited to 'upb/upb.h')
-rw-r--r-- | upb/upb.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -299,6 +299,11 @@ template <class T> class reffed_ptr { if (ptr_) ptr_->Ref(this); } + reffed_ptr(const reffed_ptr& other) + : ptr_(upb::upcast(other.get())) { + if (ptr_) ptr_->Ref(this); + } + ~reffed_ptr() { if (ptr_) ptr_->Unref(this); } template <class U> |