Better shared_ptr by distinct types for “ownership” and “reference”?
问题 I would like to use a pointer-like object Ownership<Type> m_foo for the owning object and handle Reference<Type> m_someFoo as a classical "pointer" in another context, whereas my Reference should know when the original object does not exist anymore (e.g. by returning nullptr) and it should furthermore be possible to prevent the original object from deletion for a small period of time (locking). I know that shared_ptr (Ownership) and weak_ptr (Reference) provide similar functionality. However,