討論串[問題] auto_ptr_ref的功用
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓4(4推 0噓 16→)留言20則,0人參與, 最新作者littleshan (我要加入劍道社!)時間16年前 (2009/04/30 12:22), 編輯資訊
0
0
1
內容預覽:
不是的,auto_ptr_ref 並不是用在這種地方。. 想像以下的程式碼:. auto_ptr<int> foo();. void bar(). {. .... auto_ptr<int> p_base = foo();. }. foo() 回傳的是一個暫時物件,但 auto_ptr 的 copy
(還有1115個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者omomo34415 ( )時間16年前 (2009/04/30 00:15), 編輯資訊
0
0
1
內容預覽:
請問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.
(還有191個字)
首頁
上一頁
1
下一頁
尾頁