RefCounted is a smart pointer that retains shared ownership of an object
through a pointer. Several RefCounted objects may own the same object. The
object is destroyed and its memory deallocated when either of the following
happens:
* the last remaining RefCounted owning the object is destroyed;
* the last remaining RefCounted owning the object is assigned another
pointer via opAssign or release().
The object is destroyed using the objects destructor.
A RefCounted may also own no objects, in which case it is called empty and
isNull() returns true.
All member functions can be called by multiple threads on different
instances of shared_ptr without additional synchronization even if these
instances are copies and share ownership of the same object. If multiple
threads of execution access the same shared_ptr without synchronization and
any of those accesses uses a non-const member function of shared_ptr then a
data race will occur; the shared_ptr overloads of atomic functions can be
used to prevent the data race.
RefCounted is a smart pointer that retains shared ownership of an object through a pointer. Several RefCounted objects may own the same object. The object is destroyed and its memory deallocated when either of the following happens:
* the last remaining RefCounted owning the object is destroyed; * the last remaining RefCounted owning the object is assigned another pointer via opAssign or release().
The object is destroyed using the objects destructor.
A RefCounted may also own no objects, in which case it is called empty and isNull() returns true.
All member functions can be called by multiple threads on different instances of shared_ptr without additional synchronization even if these instances are copies and share ownership of the same object. If multiple threads of execution access the same shared_ptr without synchronization and any of those accesses uses a non-const member function of shared_ptr then a data race will occur; the shared_ptr overloads of atomic functions can be used to prevent the data race.