看板 C_and_CPP 關於我們 聯絡資訊
請問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