[問題] operator base*() 傳回 base&?(Solved)
開發平台(Platform): (Ex: Win10, Linux, ...)
gun g++
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
Linux
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
class Message
{
Event *pEvent;
inline operator Event *()
{
return pEvent;
}
}
問題(Question):
pfEnentQ->add(*pMessage) 應該會轉成 Event* 傳入
但是卻傳入Event& (Refance)
餵入的資料(Input):
*pMessage
預期的正確結果(Expected Output):
pass Event* to EventQ::add(Event *)
錯誤結果(Wrong Output):
https://goo.gl/fpWBSK
程式碼(Code):(請善用置底文網頁, 記得排版)
http://codepad.org/fKzOgowK
補充說明(Supplement):
--
▁▁
Google 女友|██████████████████▕搜尋▏進階搜尋 | 使用偏好
▇▇  ̄ ̄ ̄ ̄  ̄ ̄ ̄ ̄
搜尋: ⊙所有網頁 ○中文網頁○繁體中文網頁 ○台灣的網頁
所有網頁 約有0項符合女友的查詢結果,以下是第 0項。 共費30年。
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.169.161.168
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1506842069.A.566.html
※ 編輯: kingofsdtw (118.169.161.168), 10/01/2017 15:24:22
→
10/01 15:29, , 1F
10/01 15:29, 1F
感謝...我看錯行...
花了2hr debug..QQ
※ 編輯: kingofsdtw (118.169.161.168), 10/01/2017 15:36:17
→
10/01 15:48, , 2F
10/01 15:48, 2F
→
10/01 17:07, , 3F
10/01 17:07, 3F
→
10/01 17:07, , 4F
10/01 17:07, 4F
→
10/01 17:09, , 5F
10/01 17:09, 5F
→
10/02 17:40, , 6F
10/02 17:40, 6F