In my small arkanoid clone game I'm trying to erase some values from a vector. This vector contains Brick classes, that are instantiated on the screen in a grid like pattern. When a collision happens between the ball and a brick, the brick needs to disappear. I'm trying to accomplish this with this small piece of code:
for (int i = 0; i < bricks.size(); ++i)
{
if (bricks[i].destroyed)
{
bricks.erase(bricks.begin()+i);
}
}
But unfortunately I get this compile error:
Object of type 'Brick' cannot be assigned because its copy assignment operator is implicitly deleted
When I click on this error it brings me to this piece of code:
for (; __first != __last; ++__first, (void) ++__result)
*__result = _VSTD::move(*__first);
return __result;
Can somebody give me advice how to solve this?