C++11 like smart pointers. They always use the shared allocator.
Procs
proc `=destroy`[T](p: UniquePtr[T]) {....raises: [].}
- Source Edit
proc newConstPtr[T](val: sink Isolated[T]): ConstPtr[T] {.nodestroy, inline.}
- Similar to newSharedPtr, but the underlying value can't be mutated. Source Edit
proc newUniquePtr[T](t: typedesc[T]): UniquePtr[T]
- Returns a unique pointer. It is not initialized, so reading from it before writing to it is undefined behaviour! Source Edit
proc newUniquePtr[T](val: sink Isolated[T]): UniquePtr[T] {.nodestroy.}
- Returns a unique pointer which has exclusive ownership of the value. Source Edit