[問題] list iterator not dereferencable

看板C_and_CPP (C/C++)作者 (小指)時間13年前 (2013/04/29 22:58), 編輯推噓0(007)
留言7則, 3人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) visual studio 2010 問題(Question): 設計一個多項式型別的class 在繼承list使用的過程中 發生 list iterator not dereferencable 的error 但在traverse資料結構的過程中都是照c++ reference的code去跑的 google到目前還找不出哪裡有問題 錯誤結果(Wrong Output): list iterator not dereferencable 程式碼(Code):(請善用置底文網頁, 記得排版) Polynomial.h http://pastie.org/7737961 Polynomial.cpp http://pastie.org/7737931 感謝大家 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.68.171

04/29 22:59, , 1F
不要繼承 STL Container 阿...他們都沒當爸的準備...
04/29 22:59, 1F

04/29 23:01, , 3F
04/29 23:01, 3F

04/30 00:09, , 4F
「朕不給的,你不能拿。」
04/30 00:09, 4F

04/30 23:19, , 5F
朕給的你得說:「謝主龍恩!」
04/30 23:19, 5F

04/30 23:21, , 6F
雖然是說不要繼承 STL Container, 但還是看到同事在情急
04/30 23:21, 6F

04/30 23:22, , 7F
趕工之下這樣搞, 不知道這些 code 哪天要爆得莫名其妙.
04/30 23:22, 7F
文章代碼(AID): #1HVefwip (C_and_CPP)
文章代碼(AID): #1HVefwip (C_and_CPP)