This commit adds a new class `Ptr<Type>` which represents a wrapper
over a raw pointer. This is then used as the base class of `OwnedPtr`
and `RetainPtr` providing the common simple methods (avoiding repeating
the same code in each smart pointter). The new `Ptr` class also adds
overloads of `==` and `!=` allowing `Ptr` to be compared with a given
raw pointer or another `Ptr` instance.
This commit adds two smart pointer types `OwnedPtr` and `RetainPtr`.
`OwnedPtr` acts as the sole owner of the object it manages. It is
non-copyable but the ownership can be transferred from one `OwnedPtr`
to another using move semantics.
`RetainPtr` is an intrusive reference counted smart pointer allowing
multiple pointers to share management of the same object. It requires
the underlying `Type` object to provide mechanism to track the
current retain count. This may be realized by the `Type` itself
providing this or by having it be a sub-class of the newly added
`RetainCountable` class.
This commit also add a unit test `test_smart_ptr` validating the
behavior of newly added classes.