看板 EE_DSnP 關於我們 聯絡資訊
我的 pop_front 是這樣寫的 void pop_front() { iterator li = begin(); //81 memmove ( li, ++li, sizeof(T) *(_size - 1)); //82 --_size; } 可是在compile時 出現這樣的錯誤訊息 : ../../include/array.h: In member function 「void Array<T>::pop_front() [with T = AdtTestObj]」: adtTest.h:93: instantiated from here ../../include/array.h:82: 錯誤: 不能從 「Array<AdtTestObj>::iterator」 轉換到 「void*」,為引數 「1」(屬於 「void* memmove(void*, const void*, size_t)」) 請問我該怎麼解決呢? 謝謝大家囉 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.139.56.10
timrau:li is NOT a pointer, so you should extract the pointer 05/18 23:25
timrau:inside it and feed into memmove(). 05/18 23:25
osiris5435: THX !! 05/19 00:00