討論串[問題] placement new & copy ctor
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓5(5推 0噓 11→)留言16則,0人參與, 最新作者xatier (xatier)時間12年前 (2012/05/31 23:10), 編輯資訊
1
0
1
內容預覽:
開發平台(Platform): (Ex: VC++, GCC, Linux, ...). Ubuntu Linux / g++ 4.6. 問題(Question):. http://ideone.com/f1Ctt. 我先用 operator new [] 要了一塊空間給 p. 之後想把 p 裏面每
(還有113個字)

推噓1(1推 0噓 26→)留言27則,0人參與, 最新作者darkgerm (黑駿)時間12年前 (2012/06/01 02:13), 編輯資訊
0
0
1
內容預覽:
說好的 operator new[] 結果你用了 operator new ..... 這個其實做了兩件事:. 1. T temp(kerker); 呼叫 copy ctor 初始化一個暫時物件. 2. *p = temp; 使用 copy assignment 把值複製進 *p. 但事實上 tem
(還有1073個字)
首頁
上一頁
1
下一頁
尾頁