- RefCountingPtr &operator=(T *p) { set(p); return *this; }
- RefCountingPtr &operator=(const RefCountingPtr &r)
+ /// Dereference the pointer.
+ T &operator*() const { return *data; }
+
+ /// Directly access the pointer itself without taking a reference.
+ T *get() const { return data; }
+
+ /// Assign a new value to the pointer
+ const RefCountingPtr &operator=(T *p) { set(p); return *this; }
+
+ /// Copy the pointer from another RefCountingPtr
+ const RefCountingPtr &operator=(const RefCountingPtr &r)