You're just reinventing smart pointers that have existed for yonks. Read up on how to use Boost smart pointers. In fact, reserve a few days just to get an idea of what you can achieve with Boost, it's a huge library.
Technological progress has merely provided us with more efficient means for going backwards. -- Aldous Huxley