Constructs a shared_ptr with the given memory address.
Disable copying.
Destructor.
Borrows a weak reference from the shared pointer.
Post-move operator.
Whether the smart pointer value is still valid.
The value stored within the smart pointer.
static class A { } auto p = unique_new!A(); auto b = move(p); assert(!p.isValid); assert(b.isValid);
Threadsafety: The internal reference count kept by shared_ptr is not atomic. As such you should take care with accessing the value and refcount stored within.
nulib.memory.shared_ptr.shared_ptr nulib.memory.weak_ptr.weak_ptr
A unique pointer.
Unique pointers are a specialization of shared pointers, these pointers can not be copied, only moved. numem.core.lifetime contains functions for achieving moves.
You may borrow weak references from unique_ptr, these weak references may become invalid at any point, so make sure to check the state of the object using isValid.