Implementation of my simple smart pointer in c++