Smart pointer

Several types of smart pointers exist. Some work with reference counting, others by assigning ownership of an object to one pointer.

It is worth noticing the similarity between a process whose activity body is a dummy statement, and the record concept recently proposed by C. A. R. Hoare and N. Wirth

Smart pointers can facilitate intentional programming by expressing, in the type, how the memory of the referent of the pointer will be managed. For example, if a C++ function returns a pointer, there is no way to know whether the caller should delete the memory of the referent when the caller is finished with the information.

// Transfers ownership. p3 now owns the memory and p1 is set to nullptr.

The referenced object must be protected separately to ensure thread safety.