A template class smart_ptr<T>