void DestroyBodies(vector<CBody*> & bodies) { for (vector<CBody>::iterator it = bodies.begin(); it != bodies.end(); ++it) { delete *it; *it = NULL; } }
What should I do? Displays errors
- error C2259: 'CBody': cannot instantiate abstract class (this seems to be the whole problem)
and correspondingly:
- error C2440: 'initializing': cannot convert from 'std :: _ Vector_iterator <_Ty, _Alloc>' to 'std :: _ Vector_iterator <_Ty, _Alloc>'
- error C2679: binary '! =': no ​​operator found std :: _ Vector_iterator <_Ty, _Alloc> '(or there is no acceptable conversion)
- error C2440: 'delete': cannot convert from 'CBody' to 'void *'