Improved reference-counted pointer
Merge pull request #177 from TsudaKageyu/smart-ptr

Improved reference-counted pointer