void EnemyMobs::Update(std::vector<EnemyMobs> &enemyMobOne)
{
for (int i = 0; i < playerBullets.size(); i++)
{
// Ship projectile hit enemy
if (IntersectsWith(playerBullets[i].ReturnBoundingBox()) || IntersectsWith(playerBulletsTwo[i].ReturnBoundingBox()))
{
//Deal with enemies response to collision
//Do damage
Damage();
if (ReturnHealth() <= 0)
{
for (int i = 0; i < enemyMobOne.size(); i++)
{
enemyMobOne.erase(enemyMobOne.begin() + i); //This line is the problem
}
}
}
}
}
它也在输出中说明了这个:
c:\ program files(x86)\ microsoft visual studio 2012 \ vc \ include \ xutility(2487):参见函数模板实例化'_OutIt std :: _ Move&lt; _InIt,_OutIt&gt;(_ InIt,_InIt,_OutIt, std :: _ Nonscalar_ptr_iterator_tag)'正在编译中 同 [ _OutIt = SpriteBasedGame :: EnemyMobs *, _InIt = SpriteBasedGame :: EnemyMobs * ]
我在这里做错了什么想法?感谢。