Constructor. the underlying T is constructed using the parameters.
Alias the item to this struct.
Get a reference to the item. Note that if you store a reference to this item, it is possible the item will in the future be destroyed, but the memory will still be present (until the GC cleans it up).
Assignment to another ref counted item.
Assignment to another T.
A struct to ensure only one copy of the provided item exists.
This differs from Phobos' std.typecons.RefCounted by using the GC to store the memory, instead of C's heap. The benefit here is that this version of RefCounted can be @safe.
The block containing the item is pinned in the GC until all references are gone, which means the destructor will be run synchronously when the last reference is removed. Therefore, it is safe to store a RefCounted struct inside a GC allocated type.