作者omomo34415 ( )
看板C_and_CPP
标题[问题] auto_ptr_ref的功用
时间Thu Apr 30 00:15:21 2009
请问auto_ptr的实作中为什麽要多定义
auto_ptr(auto_ptr_ref<T> rhs) throw() : ap(rhs.yp) {
}
auto_ptr& operator= (auto_ptr_ref<T> rhs) throw() { // new
reset(rhs.yp);
return *this;
}
template<class Y> operator auto_ptr_ref<Y>() throw() {
return auto_ptr_ref<Y>(release());
}
template<class Y> operator auto_ptr<Y>() throw() {
return auto_ptr<Y>(release());
}
其他的CODE的在
http://www.josuttis.com/libbook/util/autoptr.hpp.html
看不太懂这些出现的时机。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.169.194.109