大家好我试图从vector中删除void指针,程序在删除时崩溃.非常感谢你!
template <class T> class tArray_t : public vpArr_t {
virtual ~tArray_t() {
for (vector<void*>::iterator it = array.begin() ; it != array.end(); )
{
vector<void*>::iterator nextElement = it+1;
delete *it; // here is the crash
it = nextElement;
}
Run Code Online (Sandbox Code Playgroud)
};