D
dolphin
Hi All
Today , I read the source code of auto_ptr. I have a question
about the copy constructor of auto_ptr.
template<class _Ty>
class auto_ptr
{
..................
}
there is a copy constructor below
template <class _Ty1>
auto_ptr(auto_ptr<_Ty1>& __a) : _M_ptr(__a.release()) {}
What is the template<class _Ty1> mean? What is the different between
the type Ty and type _Ty1? Can a smart pointer of type _Ty1 be
reassigned to a smart pointer of type Ty?
Today , I read the source code of auto_ptr. I have a question
about the copy constructor of auto_ptr.
template<class _Ty>
class auto_ptr
{
..................
}
there is a copy constructor below
template <class _Ty1>
auto_ptr(auto_ptr<_Ty1>& __a) : _M_ptr(__a.release()) {}
What is the template<class _Ty1> mean? What is the different between
the type Ty and type _Ty1? Can a smart pointer of type _Ty1 be
reassigned to a smart pointer of type Ty?