C ++ DirectX visual studio 2012:错误C2582' operator ='函数在SpriteBasedGame :: EnemyMobs'中无法使用当试图在矢量上使用.erase时

时间:2014-03-19 19:14:50

标签: c++

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 *           ]

我在这里做错了什么想法?感谢。

0 个答案:

没有答案