[問題] functor to function pointer
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
MSVC++ 10.0
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
std
問題(Question):
runtime error
餵入的資料(Input):
預期的正確結果(Expected Output):
print
1
2
3
錯誤結果(Wrong Output):
access violation
程式碼(Code):(請善用置底文網頁, 記得排版)
http://ideone.com/1FKquB
補充說明(Supplement):
如程式碼,會死在18行
fp g3 = *g1.target<fp>();
請問應該要怎麼寫才是正確的
--
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 203.69.170.37
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1430280373.A.BC0.html
→
04/29 12:17, , 1F
04/29 12:17, 1F
→
04/29 12:17, , 2F
04/29 12:17, 2F
→
04/29 12:18, , 3F
04/29 12:18, 3F
→
04/29 12:24, , 4F
04/29 12:24, 4F
→
04/29 12:24, , 5F
04/29 12:24, 5F
→
04/29 13:02, , 6F
04/29 13:02, 6F
→
04/29 13:02, , 7F
04/29 13:02, 7F
→
04/29 13:02, , 8F
04/29 13:02, 8F
推
04/29 15:28, , 9F
04/29 15:28, 9F
→
04/29 15:28, , 10F
04/29 15:28, 10F
→
04/29 15:29, , 11F
04/29 15:29, 11F
→
04/29 15:35, , 12F
04/29 15:35, 12F
→
04/29 15:37, , 13F
04/29 15:37, 13F
推
04/29 17:29, , 14F
04/29 17:29, 14F
→
04/29 17:29, , 15F
04/29 17:29, 15F
→
04/29 17:30, , 16F
04/29 17:30, 16F
→
04/29 17:31, , 17F
04/29 17:31, 17F
→
04/29 17:32, , 18F
04/29 17:32, 18F
→
04/29 17:44, , 19F
04/29 17:44, 19F
→
04/29 18:01, , 20F
04/29 18:01, 20F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):